(data: ICreateUserData)
| 25 | } |
| 26 | |
| 27 | async create(data: ICreateUserData): Promise<IUser> { |
| 28 | const [created] = await db.insert(users).values(data).returning(); |
| 29 | |
| 30 | if (!created) { |
| 31 | throw ApiErrors.internal("Failed to create user"); |
| 32 | } |
| 33 | |
| 34 | void auditLogService.record({ |
| 35 | userId: created.id, |
| 36 | action: AUDIT_ACTIONS.USER_CREATED, |
| 37 | }); |
| 38 | |
| 39 | return created; |
| 40 | } |
| 41 | |
| 42 | async getProfile(userId: string): Promise<IPublicUserProfile> { |
| 43 | const user = await this.getById(userId); |
no test coverage detected