-
Notifications
You must be signed in to change notification settings - Fork 7
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
Ajout de la restriction sur les potentiels doublons hors meme departement #478
Conversation
const existingCog = await getCogFromDistrictID(existingAddresseDistrictID) | ||
// Departement check | ||
|
||
const sliceLength = getDepartmentSliceLength(districtID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const sliceLength = getDepartmentSliceLength(districtID) | |
const sliceLength = getDepartmentSliceLength(existingCog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ou
const sliceLength = getDepartmentSliceLength(districtID) | |
const sliceLength = getDepartmentSliceLength(currentCog) |
ce qui permet de le sortir de la boucle
const sliceLength = getDepartmentSliceLength(districtID) | ||
|
||
if (currentCog.slice(0, sliceLength) !== existingCog.slice(0, sliceLength)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
préférer un getDepartmentCode(cog), peut être plus parlant (faire le slice dedans)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
une fonction semblable existe dans lib/util/cog.cjs getCodeDepartement. Mais on ne veut peut être pas cette dépendance ici.
@@ -196,6 +198,7 @@ describe('getDeltaReport', () => { | |||
idsToCreate: [], | |||
idsToUpdate: [bddAddressMock[0].id], | |||
idsToDelete: [], | |||
idsUnauthorized: [] | |||
}) | |||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serait bien de rajouter un test idsUnauthorized, pour pour ce cas hors departement
No description provided.