Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

email modal with ajax update on user model + bugfix uuid in user model #1

Closed
wants to merge 2 commits into from

2 participants

@isery

The email modal will only appear if the user has not yet submitted his email. I was not able to get the email from the meetup api.

@isery isery commented on the diff
api/models/User.js
@@ -12,33 +12,27 @@ module.exports = {
attributes: {
uuid: {
- type: 'string',
- primaryKey: true,
- unique: true,
- required: true,
- uuidv4: true
+ type: 'STRING',
+ primaryKey: true,
+ uuidv4: true,
+ defaultsTo: uuid.v4
@isery
isery added a note

uuid.v4 is actually a function and creates a uuid if not set

@thomasfr Owner

:+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@isery isery commented on the diff
api/models/User.js
((29 lines not shown))
type: 'integer'
}
- },
-
-
- beforeValidate: function (values, next) {
- if (_.isEmpty(values.uuid)) {
- values.uuid = uuid.v4();
- }
- next();
}
@isery
isery added a note

this function gets also called on update and wants to create a new uuid which is not allowed bcs its a primaryKey. You also cannot change it to beforeCreate because then the validation will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@thomasfr
Owner

:+1:

@thomasfr thomasfr closed this
@thomasfr
Owner

Wrong branch. Correct Pull Request already merged into master #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.