Fix offer retrieval method and add GDPR acknowledgment

Return the result from `getOffersById` method to fix route handling. Add `id` field in offers selection query and introduce `gdpr_acknowledgement` to the user model and mock data for GDPR compliance.
This commit is contained in:
Mathis H (Avnyr) 2024-11-24 23:49:59 +01:00
parent ebdc3d0109
commit 55ec13c0a7
Signed by: Mathis
GPG Key ID: DD9E0666A747D126
4 changed files with 5 additions and 1 deletions

View File

@ -86,6 +86,8 @@ model User {
created_at DateTime @default(now())
updated_at DateTime @default(now()) @updatedAt
gdpr_acknowledgement DateTime @default(now())
Role Role @relation(fields: [roleId], references: [id])
UserHasCrypto UserHasCrypto[]
TradeGiven Trade[] @relation("Giver")

View File

@ -58,6 +58,6 @@ export class OfferController {
@HttpCode(HttpStatus.FOUND)
@Get("crypto/:cryptoId")
getOffersById(@GetUser() user: User,@Param("cryptoId") cryptoId: string) {
this.offerService.getOffersById(user.id, cryptoId)
return this.offerService.getOffersById(user.id, cryptoId)
}
}

View File

@ -44,6 +44,7 @@ export class OfferService {
created_at: "desc",
},
select: {
id: true,
amount: true,
created_at: true,
id_user: true,

View File

@ -11,6 +11,7 @@ export const getMockUser = (): User => ({
isActive: true,
created_at: new Date(),
updated_at: new Date(),
gdpr_acknowledgement: new Date(),
roleId: "user",
dollarAvailables: 1000,
});