Skip to content

Commit fb4176b

Browse files
authored
fix(body): add external type (#1039)
Co-authored-by: Rik Smale <[email protected]>
1 parent c1a3e2f commit fb4176b

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

models/Body.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ const Body = sequelize.define('body', {
6262
allowNull: true,
6363
},
6464
type: {
65-
type: Sequelize.ENUM('antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'other'),
65+
type: Sequelize.ENUM('antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'external', 'other'),
6666
allowNull: false,
6767
defaultValue: 'antenna',
6868
validate: {
6969
isIn: {
70-
args: [['antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'other']],
71-
msg: 'Type must be one of these: "antenna", "contact antenna", "contact", "interest group", "working group", "commission", "committee", "project", "partner", "other".'
70+
args: [['antenna', 'contact antenna', 'contact', 'interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'external', 'other']],
71+
msg: 'Type must be one of these: "antenna", "contact antenna", "contact", "interest group", "working group", "commission", "committee", "project", "partner", "external", "other".'
7272
}
7373
}
7474
},

scripts/seed.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ async function createBodies() {
4848
'Committee',
4949
'Project',
5050
'Partner',
51+
'External',
5152
'Other'
5253
];
5354

@@ -61,6 +62,7 @@ async function createBodies() {
6162
'COT',
6263
'PRO',
6364
'PAR',
65+
'EXT',
6466
'OTH'
6567
];
6668

test/api/bodies-creating.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('Bodies creating', () => {
102102
});
103103
}
104104

105-
for (const type of ['interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'other']) {
105+
for (const type of ['interest group', 'working group', 'commission', 'committee', 'project', 'partner', 'external', 'other']) {
106106
test(`should succeed when foundation date is empty on ${type}`, async () => {
107107
const user = await generator.createUser({ username: 'test', mail_confirmed_at: new Date(), superadmin: true });
108108
const token = await generator.createAccessToken(user);

test/api/bodies-editing.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe('Bodies editing', () => {
183183
});
184184
}
185185

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

0 commit comments

Comments
 (0)