-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feat/clin 2095 #35
Feat/clin 2095 #35
Conversation
dc38c99
to
f7891b4
Compare
93527cd
to
6297a5e
Compare
isUUID: 4, | ||
}, | ||
}, | ||
title: { |
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.
sommes-nous sûr qu'il n'y a pas de titre funky avec des tirets "-
" ou autres caractères du genre?
src/db/models/SavedFilter.ts
Outdated
}, | ||
keycloak_id: { | ||
type: DataTypes.STRING, | ||
allowNull: false, | ||
validate: { | ||
isUUID: 4, |
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.
Magic number.
const VERSION_4 = 4
ou const UUID_VERSION = 4
ou ...
ou regarder dans la lib sequilize si il existe une constante que tu pourrais importer au lieu de t'en créer une
"keycloak-connect": "^15.0.2", | ||
"node-pg-migrate": "^6.0.0", | ||
"pg": "^8.7.1", | ||
"sequelize": "^6.14.1", | ||
"sequelize": "^6.28.2", |
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.
👍
src/db/models/User.ts
Outdated
len: [1, 20], | ||
isAlpha: true, | ||
}, | ||
}, | ||
last_name: { | ||
type: DataTypes.CITEXT, | ||
validate: { | ||
len: [1, 20], |
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.
go with MAX=70
src/db/models/User.ts
Outdated
isAlpha: true, | ||
}, | ||
}, | ||
nih_ned_id: { | ||
type: DataTypes.STRING, | ||
validate: { | ||
isAlpha: true, | ||
}, | ||
}, | ||
commercial_use_reason: { | ||
type: DataTypes.STRING, | ||
validate: { | ||
isAlpha: true, |
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.
alphanumeric
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.
Je pense qu'on devrait ajouter plus de validation de longeur, mais on pourra le faire dans un 2ième temps. Faut s'assurer que dans les BDs actuelles, on mette pas des contraintes qui ne soient pas compatibles avec le contenu de certains champs
src/db/models/UserSets.ts
Outdated
isUUID: 4, | ||
}, | ||
}, | ||
keycloak_id: { | ||
type: DataTypes.STRING, | ||
allowNull: false, | ||
validate: { | ||
isUUID: 4, |
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.
même commentaire que plus haut
src/utils/errors.ts
Outdated
name: 'Invalid data', | ||
errors: err.errors.map((error) => error.message.replace('%s', error.path)), | ||
}; | ||
res.status(422).json({ |
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.
- magic number
- tu peux le laisser sur un 422, mais pas sûr que ce soit nécéssairement le bon code...
# Conflicts: # src/db/models/SavedFilter.ts
bf3a4c2
to
2a43e2d
Compare
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.
LGTM
5a46c39
to
9a28c1f
Compare
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.
Can we add a custom validator for roles? making sure every role is alphanumerical only
No description provided.