Skip to content

Commit

Permalink
FPO-290 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee365 committed Jun 27, 2024
1 parent 94447a6 commit 41e8f1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/controllers/usersController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export class UserController {
const reference = req.body.applicationReference as string
const status = req.body.status as string

console.log('ThisorganisationId:', organisationId)
console.log('Thisreference:', reference)
console.log('Mystatus:', status)

await this.organisationRepository.updateOrganisation(organisationId, reference, status)
res.status(201).json({ organisationId })
}
Expand Down
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

0 comments on commit 41e8f1f

Please sign in to comment.