Skip to content

Commit

Permalink
Merge pull request #50 from trade-tariff/FPO-290-2
Browse files Browse the repository at this point in the history
FPO-290 changes
  • Loading branch information
mkayad authored Jun 27, 2024
2 parents 94447a6 + 5707fb5 commit 56049af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/operations/updateOrganisation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ class UpdateOrganisation {
this.client = client
}

async call (id: string, reference: string, status: string): Promise<void> {
async call (id: string, applicationReference: string, applicationStatus: string): Promise<void> {
const input: UpdateItemCommandInput = {
TableName,
Key: {
OrganisationId: { S: id }
},
UpdateExpression: 'SET ApplicationReference = :reference, Status = :status'
UpdateExpression: 'SET ApplicationReference = :applicationReference, #Status = :applicationStatus',
ExpressionAttributeValues: {
':applicationReference': { S: applicationReference },
':applicationStatus': { S: applicationStatus }
},
ExpressionAttributeNames: {
'#Status': 'Status'
}
}

const command = new UpdateItemCommand(input)
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ router.delete('/keys/:organisationId/:id', (req, res) => { apiKeyController.dest
router.post('/users/:id', (req, res) => { userController.create(req, res) })
router.get('/users/:id', (req, res) => { userController.show(req, res) })

router.patch('/organisation/:organisationId', (req, res) => { userController.updateOrganisation(req, res) })
router.patch('/organisations/:organisationId', (req, res) => { userController.updateOrganisation(req, res) })

/* eslint-enable @typescript-eslint/no-floating-promises */

Expand Down

0 comments on commit 56049af

Please sign in to comment.