We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb96dd9 commit 7afe81eCopy full SHA for 7afe81e
api/src/core/usecases/importFromSource.ts
@@ -27,7 +27,20 @@ export const importFromHALSource: (dbApi: DbApiV2) => (agentEmail: string) => Pr
27
const index = dbSoftwaresNames.indexOf(software.title_s[0]);
28
29
if (index != -1) {
30
+ if (dbSoftwares[index].externalId === software.docid) {
31
+ return dbSoftwares[index].softwareId;
32
+ }
33
+
34
+ // Not equal -> new HAL notice version, need to update
35
+ const newSoft = await halRawSoftwareToSoftwareForm(software);
36
+ await dbApi.software.update({
37
+ softwareSillId: dbSoftwares[index].softwareId,
38
+ formData: newSoft,
39
+ agentId: agentId
40
+ });
41
42
return dbSoftwares[index].softwareId;
43
44
} else {
45
console.info("Importing HAL : ", software.docid);
46
const newSoft = await halRawSoftwareToSoftwareForm(software);
0 commit comments