mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-09 06:00:12 +02:00
fix: fixed quantity display on cryptos
This commit is contained in:
parent
cf8fbe4fe5
commit
49faaf4fa0
@ -1,12 +1,12 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
// Delete,
|
||||
Get,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Param,
|
||||
Patch,
|
||||
// Patch,
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
@ -55,19 +55,19 @@ export class CryptoController {
|
||||
) {
|
||||
return this.cryptoService.buyCrypto(user.id, dto);
|
||||
}
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Patch('/update/:id')
|
||||
editCryptoById(
|
||||
@Param('id') cryptoId: string,
|
||||
@Body() dto: CryptoDto,
|
||||
@GetUser() user: User,
|
||||
) {
|
||||
return this.cryptoService.editCryptoById(user.id, cryptoId, dto);
|
||||
}
|
||||
// @HttpCode(HttpStatus.OK)
|
||||
// @Patch('/update/:id')
|
||||
// editCryptoById(
|
||||
// @Param('id') cryptoId: string,
|
||||
// @Body() dto: CryptoDto,
|
||||
// @GetUser() user: User,
|
||||
// ) {
|
||||
// return this.cryptoService.editCryptoById(user.id, cryptoId, dto);
|
||||
// }
|
||||
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@Delete('/delete/:id')
|
||||
deleteOfferById(@Param('id') roleId: string, @GetUser() user: User) {
|
||||
return this.cryptoService.deleteCryptoById(user.id, roleId);
|
||||
}
|
||||
// @HttpCode(HttpStatus.NO_CONTENT)
|
||||
// @Delete('/delete/:id')
|
||||
// deleteOfferById(@Param('id') roleId: string, @GetUser() user: User) {
|
||||
// return this.cryptoService.deleteCryptoById(user.id, roleId);
|
||||
// }
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ export class CryptoService {
|
||||
await checkUserHasAccount(userId);
|
||||
|
||||
if (cryptoId) {
|
||||
return this.prisma.crypto.findMany({
|
||||
return this.prisma.cryptoHistory.findMany({
|
||||
where: {
|
||||
id: cryptoId,
|
||||
id_crypto: cryptoId,
|
||||
},
|
||||
|
||||
orderBy: {
|
||||
|
@ -21,6 +21,7 @@ export class UserService {
|
||||
UserHasCrypto: {
|
||||
select: {
|
||||
Crypto: true,
|
||||
amount: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -40,10 +41,14 @@ export class UserService {
|
||||
UserHasCrypto: {
|
||||
select: {
|
||||
Crypto: true,
|
||||
amount: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
take: 50,
|
||||
orderBy: {
|
||||
dollarAvailables: 'desc',
|
||||
},
|
||||
});
|
||||
return user;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user