Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Szotkowski committed Sep 14, 2023
1 parent 9b126d7 commit 674d6c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ import {
import {ServiceMixin} from '@loopback/service-proxy';
import * as dotenv from 'dotenv';
import path from 'path';
import {InstructionStepController, PingController, UserController, UserInstructionController, UserLinkController, UserProgressController} from './controllers';
import {
InstructionStepController,
PingController,
UserController,
UserInstructionController,
UserLinkController,
UserProgressController,
} from './controllers';
import {DbDataSource} from './datasources';
import {
InstructionRepository,
Expand Down
9 changes: 5 additions & 4 deletions src/controllers/user-instruction.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class UserInstructionController {
@repository(StepRepository) public stepRepository: StepRepository,
@repository(UserRepository)
protected progressRepository: ProgressRepository,
) { }
) {}

@authenticate('jwt')
@post('/users/{id}/instructions/{instructionId}', {
Expand Down Expand Up @@ -279,9 +279,10 @@ export class UserInstructionController {
},
},
})
async getUsersInstructions(): Promise<
{instreuctions: Omit<Instruction, 'deleteHash' | 'premiumUserIds'>[]; progress: (Progress & ProgressRelations)[];}
> {
async getUsersInstructions(): Promise<{
instreuctions: Omit<Instruction, 'deleteHash' | 'premiumUserIds'>[];
progress: (Progress & ProgressRelations)[];
}> {
const user = await this.userRepository.findById(this.user.id);
if (!user) {
throw new HttpErrors.NotFound('User not found');
Expand Down

0 comments on commit 674d6c0

Please sign in to comment.