Skip to content

Commit

Permalink
WIP: pass access token to backend for list services
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-Andrews99 committed Sep 16, 2024
1 parent 775d1bb commit 90f1fc3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions express/src/services/lambda-facade/LambdaFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export default class LambdaFacade implements LambdaFacadeInterface {
}
}

listServices(userId: string): Promise<AxiosResponse> {
return this.get(`/get-services/${userId}`);
listServices(userId: string, accessToken: string): Promise<AxiosResponse> {
return this.get(`/get-services/${userId}`, accessToken);
}

listClients(serviceId: string, accessToken: string): Promise<AxiosResponse<QueryCommandOutput>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default interface LambdaFacadeInterface {

generateClient(service: Service, authenticationResult: AuthenticationResultType): Promise<AxiosResponse>;

listServices(userId: string): Promise<AxiosResponse>;
listServices(userId: string, accessToken: string): Promise<AxiosResponse>;

// TODO The QueryCommandOutput type should be replaced by a class shared between the frontend and the API (contract)
listClients(serviceId: string, accessToken: string): Promise<AxiosResponse<QueryCommandOutput>>;
Expand Down
2 changes: 1 addition & 1 deletion express/src/services/self-service-services-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export default class SelfServiceServicesService {
async listServices(userId: string, accessToken: string): Promise<Service[]> {
console.info("In self-service-services-service:listServices()");
await this.validateToken(accessToken, "listServices");
return dynamoServicesToDomainServices((await this.lambda.listServices(userId)).data.Items);
return dynamoServicesToDomainServices((await this.lambda.listServices(userId, accessToken)).data.Items);
}

async updateUser(userId: string, updates: UserUpdates, accessToken: string): Promise<void> {
Expand Down

0 comments on commit 90f1fc3

Please sign in to comment.