|
52 | 52 | const props = defineProps({ |
53 | 53 | multiple: { type: Boolean, required: true }, |
54 | 54 | input_geode_object: { type: String, required: true }, |
55 | | - files: { type: Array, required: true }, |
| 55 | + filenames: { type: Array, required: true }, |
56 | 56 | route: { type: String, required: true }, |
57 | 57 | schema: { type: Object, required: true }, |
58 | 58 | }) |
59 | 59 |
|
60 | | - const { multiple, input_geode_object, files, route, schema } = props |
| 60 | + const { multiple, input_geode_object, filenames, route, schema } = props |
61 | 61 |
|
62 | 62 | const accept = ref("") |
63 | 63 | const loading = ref(false) |
|
76 | 76 | mandatory_files.value = [] |
77 | 77 | additional_files.value = [] |
78 | 78 | toggle_loading() |
79 | | - for (const file of files) { |
80 | | - const params = { input_geode_object, filename: file.name } |
81 | | - await api_fetch( |
82 | | - { schema, params }, |
83 | | - { |
84 | | - response_function: (response) => { |
85 | | - has_missing_files.value = response._data.has_missing_files |
86 | | - mandatory_files.value = [].concat( |
87 | | - mandatory_files.value, |
88 | | - response._data.mandatory_files, |
89 | | - ) |
90 | | - additional_files.value = [].concat( |
91 | | - additional_files.value, |
92 | | - response._data.additional_files, |
93 | | - ) |
94 | | - const files_list = [].concat( |
95 | | - mandatory_files.value, |
96 | | - additional_files.value, |
97 | | - ) |
98 | | - accept.value = files_list |
99 | | - .map((filename) => "." + filename.split(".").pop()) |
100 | | - .join(",") |
101 | | - if (!has_missing_files.value) { |
102 | | - console.log("MISSING FILESSELECTOR increment_step") |
103 | | - emit("increment_step") |
104 | | - } |
105 | | - }, |
| 79 | + const params = { input_geode_object, filenames } |
| 80 | + await api_fetch( |
| 81 | + { schema, params }, |
| 82 | + { |
| 83 | + response_function: (response) => { |
| 84 | + has_missing_files.value = response._data.has_missing_files |
| 85 | + mandatory_files.value = response._data.mandatory_files |
| 86 | + additional_files.value = response._data.additional_files |
| 87 | +
|
| 88 | + console.log("response", response) |
| 89 | +
|
| 90 | + const files_list = [].concat( |
| 91 | + mandatory_files.value, |
| 92 | + additional_files.value, |
| 93 | + ) |
| 94 | + accept.value = files_list |
| 95 | + .map((filename) => "." + filename.split(".").pop()) |
| 96 | + .join(",") |
| 97 | + if (!has_missing_files.value) { |
| 98 | + emit("increment_step") |
| 99 | + } |
106 | 100 | }, |
107 | | - ) |
108 | | - } |
| 101 | + }, |
| 102 | + ) |
| 103 | +
|
109 | 104 | toggle_loading() |
110 | 105 | } |
111 | 106 |
|
|
0 commit comments