Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #328 : fix import new version software from HAL #334

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

guillermau
Copy link
Collaborator

closes #328

@guillermau guillermau changed the title fix #328 : fix import new HAL notice fix #328 : fix import new version software from HAL Apr 2, 2025
@guillermau guillermau self-assigned this Apr 2, 2025
@@ -27,7 +27,20 @@ export const importFromHALSource: (dbApi: DbApiV2) => (agentEmail: string) => Pr
const index = dbSoftwaresNames.indexOf(software.title_s[0]);

if (index != -1) {
return dbSoftwares[index].softwareId;
console.log(dbSoftwares[index].externalId, " == ", software.docid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tu veux garder ce log ?

Comment on lines 31 to 43
if (dbSoftwares[index].externalId === software.docid) {
return dbSoftwares[index].softwareId;
} else {
// New HAL notice version, need to update
let newSoft = await halRawSoftwareToSoftwareForm(software);
await dbApi.software.update({
softwareSillId: dbSoftwares[index].softwareId,
formData: newSoft,
agentId: agentId
});

return dbSoftwares[index].softwareId;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on peut alléger un peu (sans else car on return) et tu as un let au lieu de const

Suggested change
if (dbSoftwares[index].externalId === software.docid) {
return dbSoftwares[index].softwareId;
} else {
// New HAL notice version, need to update
let newSoft = await halRawSoftwareToSoftwareForm(software);
await dbApi.software.update({
softwareSillId: dbSoftwares[index].softwareId,
formData: newSoft,
agentId: agentId
});
return dbSoftwares[index].softwareId;
}
if (dbSoftwares[index].externalId === software.docid) {
return dbSoftwares[index].softwareId;
}
// New HAL notice version, need to update | On garde ce commentaire ??
const newSoft = await halRawSoftwareToSoftwareForm(software);
await dbApi.software.update({
softwareSillId: dbSoftwares[index].softwareId,
formData: newSoft,
agentId: agentId
});
return dbSoftwares[index].softwareId;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synchronization issue?
2 participants