Skip to content

Commit

Permalink
se añadió campo default para el atributo extra; se modificó el test c…
Browse files Browse the repository at this point in the history
…orrespondiente
  • Loading branch information
freddcastro committed Nov 14, 2024
1 parent 9ed5f4c commit de21776
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/controllers/accounts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ helpers.getUserDataByUserSlug = async function (userslug, callerUID, query = {})
await parseAboutMe(results.userData);

let { userData } = results;

const { userSettings, isAdmin, isGlobalModerator, isModerator, canViewInfo } = results;
const isSelf = parseInt(callerUID, 10) === parseInt(userData.uid, 10);

Expand Down
2 changes: 1 addition & 1 deletion src/user/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function (User) {
joindate: timestamp,
lastonline: timestamp,
status: 'online',
isProfessor: data.isProfessor == 'on'
isProfessor: data.isProfessor == 'on' || false

Check failure on line 53 in src/user/create.js

View workflow job for this annotation

GitHub Actions / test

Expected '===' and instead saw '=='

Check failure on line 53 in src/user/create.js

View workflow job for this annotation

GitHub Actions / test

Missing trailing comma
};
['picture', 'fullname', 'location', 'birthday'].forEach((field) => {
if (data[field]) {
Expand Down
2 changes: 1 addition & 1 deletion test/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('User', () => {

describe('.create(), when created', () => {
it('should be created properly', async () => {
testUid = await User.create({ username: userData.username, password: userData.password });
testUid = await User.create({ username: userData.username, password: userData.password, isProfessor: 'on'});
assert.ok(testUid);

await User.setUserField(testUid, 'email', userData.email);
Expand Down

0 comments on commit de21776

Please sign in to comment.