Skip to content

Commit

Permalink
feat: ability to upsert single legal values
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Jan 3, 2025
1 parent a0bc011 commit 20dae18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/lib/features/context/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ test('should add and update a single context field with new legal values', async

// non existent context
await request
.put(`${base}/api/admin/context/doesntexist/legalValues`)
.post(`${base}/api/admin/context/doesntexist/legalValues`)
.send({
value: 'local',
description: 'Local environment',
Expand All @@ -166,7 +166,7 @@ test('should add and update a single context field with new legal values', async

// invalid schema
await request
.put(`${base}/api/admin/context/environment/legalValues`)
.post(`${base}/api/admin/context/environment/legalValues`)
.send({
valueInvalid: 'invalid schema',
description: 'Local environment',
Expand All @@ -176,7 +176,7 @@ test('should add and update a single context field with new legal values', async

// add a new context field legal value
await request
.put(`${base}/api/admin/context/environment/legalValues`)
.post(`${base}/api/admin/context/environment/legalValues`)
.send({
value: 'newvalue',
description: 'new description',
Expand All @@ -186,7 +186,7 @@ test('should add and update a single context field with new legal values', async

// update existing context field legal value description
await request
.put(`${base}/api/admin/context/environment/legalValues`)
.post(`${base}/api/admin/context/environment/legalValues`)
.send({
value: 'newvalue',
description: 'updated description',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/features/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class ContextController extends Controller {
});

this.route({
method: 'put',
method: 'post',
path: '/:contextField/legalValues',
handler: this.updateContextFieldLegalValue,
permission: UPDATE_CONTEXT_FIELD,
Expand Down

0 comments on commit 20dae18

Please sign in to comment.