diff --git a/src/controllers/instruction-step.controller.ts b/src/controllers/instruction-step.controller.ts index 0546632..7cae2f9 100644 --- a/src/controllers/instruction-step.controller.ts +++ b/src/controllers/instruction-step.controller.ts @@ -77,7 +77,7 @@ export class InstructionStepController { }, }) step: Omit, - ): Promise { + ): Promise { const user = await this.userRepository.findById(this.user.id); if (!user) { throw new HttpErrors.NotFound('User not found'); @@ -88,11 +88,11 @@ export class InstructionStepController { throw new HttpErrors.NotFound('Instruction not found'); } this.validateInstructionOwnership(instruction); - await this.stepRepository.create({ + const newStep = await this.stepRepository.create({ ...step, instructionId: instructionId, }); - return true; + return newStep; } @authenticate('jwt') diff --git a/src/controllers/user-instruction.controller.ts b/src/controllers/user-instruction.controller.ts index ed11d3d..4b37878 100644 --- a/src/controllers/user-instruction.controller.ts +++ b/src/controllers/user-instruction.controller.ts @@ -76,16 +76,16 @@ export class UserInstructionController { Instruction, 'id' | 'userId' | 'date' | 'link' | 'deleteHash' | 'premium' >, - ): Promise { + ): Promise { const user = await this.userRepository.findById(this.user.id); if (!user) { throw new HttpErrors.NotFound('User not found'); } - await this.instructionRepository.create({ + const newInstruction = await this.instructionRepository.create({ ...instruction, userId: this.user.id, }); - return true; + return newInstruction; } @authenticate('jwt') diff --git a/src/controllers/user-link.controller.ts b/src/controllers/user-link.controller.ts index 0230994..85a1025 100644 --- a/src/controllers/user-link.controller.ts +++ b/src/controllers/user-link.controller.ts @@ -16,10 +16,10 @@ export class UserLinkController { @repository(UserRepository) public userRepository: UserRepository, @repository(UserLinkRepository) public userLinkRepository: UserLinkRepository, - ) {} + ) { } @authenticate('jwt') - @post('/users/{id}//follow/{followeeId}') + @post('/users/{id}/follow/{followeeId}') async followUser( @param.path.number('followeeId') followeeId: number, ): Promise { @@ -39,7 +39,7 @@ export class UserLinkController { } @authenticate('jwt') - @del('/users/{id}//unfollow/{followeeId}') + @del('/users/{id}/unfollow/{followeeId}') async unfollowUser( @param.path.number('followeeId') followeeId: number, ): Promise { diff --git a/src/controllers/user.controller.ts b/src/controllers/user.controller.ts index 1355098..1b76c65 100644 --- a/src/controllers/user.controller.ts +++ b/src/controllers/user.controller.ts @@ -722,7 +722,7 @@ export class UserController { return usernamesAndLinks; } - @get('/user-detail', { + @get('/user-detail/{id}', { responses: { '200': { description: 'Get user detail',