diff --git a/src/controllers/usersController.ts b/src/controllers/usersController.ts index f0942c1..486c159 100644 --- a/src/controllers/usersController.ts +++ b/src/controllers/usersController.ts @@ -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 }) } diff --git a/src/operations/updateOrganisation.ts b/src/operations/updateOrganisation.ts index 2cd5183..2cf7090 100644 --- a/src/operations/updateOrganisation.ts +++ b/src/operations/updateOrganisation.ts @@ -9,13 +9,20 @@ class UpdateOrganisation { this.client = client } - async call (id: string, reference: string, status: string): Promise { + async call (id: string, applicationReference: string, applicationStatus: string): Promise { 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)