Skip to content

Commit

Permalink
fix(body): add external type (#1039)
Browse files Browse the repository at this point in the history
Co-authored-by: Rik Smale <WikiRik@users.noreply.github.com>
  • Loading branch information
WikiRik and WikiRik authored Dec 5, 2024
1 parent c1a3e2f commit fb4176b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions models/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ const Body = sequelize.define('body', {
allowNull: true,
},
type: {
type: Sequelize.ENUM('antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'other'),
type: Sequelize.ENUM('antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'external', 'other'),
allowNull: false,
defaultValue: 'antenna',
validate: {
isIn: {
args: [['antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'other']],
msg: 'Type must be one of these: "antenna", "contact antenna", "contact", "interest group", "working group", "commission", "committee", "project", "partner", "other".'
args: [['antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'external', 'other']],
msg: 'Type must be one of these: "antenna", "contact antenna", "contact", "interest group", "working group", "commission", "committee", "project", "partner", "external", "other".'
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions scripts/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async function createBodies() {
'Committee',
'Project',
'Partner',
'External',
'Other'
];

Expand All @@ -61,6 +62,7 @@ async function createBodies() {
'COT',
'PRO',
'PAR',
'EXT',
'OTH'
];

Expand Down
2 changes: 1 addition & 1 deletion test/api/bodies-creating.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('Bodies creating', () => {
});
}

for (const type of ['interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'other']) {
for (const type of ['interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'external', 'other']) {
test(`should succeed when foundation date is empty on ${type}`, async () => {
const user = await generator.createUser({ username: 'test', mail_confirmed_at: new Date(), superadmin: true });
const token = await generator.createAccessToken(user);
Expand Down
2 changes: 1 addition & 1 deletion test/api/bodies-editing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('Bodies editing', () => {
});
}

for (const type of ['interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'other']) {
for (const type of ['interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'external', 'other']) {
test(`should succeed when foundation date is empty on ${type}`, async () => {
const user = await generator.createUser({ superadmin: true });
const token = await generator.createAccessToken(user);
Expand Down

0 comments on commit fb4176b

Please sign in to comment.