feat: add avatar change
This commit is contained in:
parent
4c3ed33bf3
commit
8b3b726798
@ -3,7 +3,7 @@ import type { ClientGrpc } from '@nestjs/microservices'
|
|||||||
import {
|
import {
|
||||||
AccountServiceClient,
|
AccountServiceClient,
|
||||||
GetAccountRequest
|
GetAccountRequest
|
||||||
} from '@teacinema/contracts/gen/account'
|
} from '@teacinema/contracts/gen/ts/account'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AccountClientGrpc implements OnModuleInit {
|
export class AccountClientGrpc implements OnModuleInit {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import type {
|
|||||||
GetMeResponse,
|
GetMeResponse,
|
||||||
PatchUserRequest,
|
PatchUserRequest,
|
||||||
PatchUserResponse
|
PatchUserResponse
|
||||||
} from '@teacinema/contracts/gen/users'
|
} from '@teacinema/contracts/gen/ts/users'
|
||||||
|
|
||||||
import { UsersService } from './users.service'
|
import { UsersService } from './users.service'
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
GetMeResponse,
|
GetMeResponse,
|
||||||
PatchUserRequest,
|
PatchUserRequest,
|
||||||
PatchUserResponse
|
PatchUserResponse
|
||||||
} from '@teacinema/contracts/gen/users'
|
} from '@teacinema/contracts/gen/ts/users'
|
||||||
import { lastValueFrom } from 'rxjs'
|
import { lastValueFrom } from 'rxjs'
|
||||||
|
|
||||||
import { AccountClientGrpc } from '../../infra/grpc/clients/account.client'
|
import { AccountClientGrpc } from '../../infra/grpc/clients/account.client'
|
||||||
@ -58,7 +58,7 @@ export class UsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async patchUser(data: PatchUserRequest): Promise<PatchUserResponse> {
|
public async patchUser(data: PatchUserRequest): Promise<PatchUserResponse> {
|
||||||
const { name, userId } = data
|
const { name, userId, avatar } = data
|
||||||
|
|
||||||
const user = await this.repository.findById(userId)
|
const user = await this.repository.findById(userId)
|
||||||
|
|
||||||
@ -70,7 +70,8 @@ export class UsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await this.repository.update(userId, {
|
await this.repository.update(userId, {
|
||||||
...(name !== undefined && { name })
|
...(name !== undefined && { name }),
|
||||||
|
...(avatar !== undefined && { avatar })
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
28
yarn.lock
28
yarn.lock
@ -1036,10 +1036,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@nestjs/mapped-types/-/mapped-types-2.1.0.tgz#b9b536b7c3571567aa1d0223db8baa1a51505a19"
|
resolved "https://registry.yarnpkg.com/@nestjs/mapped-types/-/mapped-types-2.1.0.tgz#b9b536b7c3571567aa1d0223db8baa1a51505a19"
|
||||||
integrity sha512-W+n+rM69XsFdwORF11UqJahn4J3xi4g/ZEOlJNL6KoW5ygWSmBB2p0S2BZ4FQeS/NDH72e6xIcu35SfJnE8bXw==
|
integrity sha512-W+n+rM69XsFdwORF11UqJahn4J3xi4g/ZEOlJNL6KoW5ygWSmBB2p0S2BZ4FQeS/NDH72e6xIcu35SfJnE8bXw==
|
||||||
|
|
||||||
"@nestjs/microservices@^11.1.12", "@nestjs/microservices@^11.1.16":
|
"@nestjs/microservices@^11.1.12":
|
||||||
version "11.1.16"
|
version "11.1.17"
|
||||||
resolved "https://registry.yarnpkg.com/@nestjs/microservices/-/microservices-11.1.16.tgz#6f445c44adcee88af983830e0667c93ccefe2869"
|
resolved "https://registry.yarnpkg.com/@nestjs/microservices/-/microservices-11.1.17.tgz#f2b1aa25e24532377477a437583f1af002118602"
|
||||||
integrity sha512-eG/ArIq0UJyR3i/GTYuApA4OZylhuLGacVaVT9mMxQgT7ZTpp5CZgOwLNdcUUdOS6qypK3waG1m2AC54xzdf0Q==
|
integrity sha512-rubBPEEXS9PwA3LwdNN/ytjEUmON+d8+4fbiUCIFGW8i+rR/g36vrpwuvoAzcGpxlu45/TpZPfHTb0nJciG9Yw==
|
||||||
dependencies:
|
dependencies:
|
||||||
iterare "1.2.1"
|
iterare "1.2.1"
|
||||||
tslib "2.8.1"
|
tslib "2.8.1"
|
||||||
@ -1052,6 +1052,14 @@
|
|||||||
iterare "1.2.1"
|
iterare "1.2.1"
|
||||||
tslib "2.8.1"
|
tslib "2.8.1"
|
||||||
|
|
||||||
|
"@nestjs/microservices@^11.1.16":
|
||||||
|
version "11.1.16"
|
||||||
|
resolved "https://registry.yarnpkg.com/@nestjs/microservices/-/microservices-11.1.16.tgz#6f445c44adcee88af983830e0667c93ccefe2869"
|
||||||
|
integrity sha512-eG/ArIq0UJyR3i/GTYuApA4OZylhuLGacVaVT9mMxQgT7ZTpp5CZgOwLNdcUUdOS6qypK3waG1m2AC54xzdf0Q==
|
||||||
|
dependencies:
|
||||||
|
iterare "1.2.1"
|
||||||
|
tslib "2.8.1"
|
||||||
|
|
||||||
"@nestjs/platform-express@^11.0.1":
|
"@nestjs/platform-express@^11.0.1":
|
||||||
version "11.1.14"
|
version "11.1.14"
|
||||||
resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-11.1.14.tgz#909d88f81ad2114c0f61fe5731bbaa65de8075a6"
|
resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-11.1.14.tgz#909d88f81ad2114c0f61fe5731bbaa65de8075a6"
|
||||||
@ -1202,7 +1210,17 @@
|
|||||||
"@nestjs/microservices" "^11.1.16"
|
"@nestjs/microservices" "^11.1.16"
|
||||||
"@teacinema/contracts" "^1.1.3"
|
"@teacinema/contracts" "^1.1.3"
|
||||||
|
|
||||||
"@teacinema/contracts@^1.1.2", "@teacinema/contracts@^1.1.3":
|
"@teacinema/contracts@^1.1.2":
|
||||||
|
version "1.1.7"
|
||||||
|
resolved "https://git.ksv741.keenetic.pro/api/packages/teacinema/npm/%40teacinema%2Fcontracts/-/1.1.7/contracts-1.1.7.tgz#127cc16d0e68e79c910edeb2bd94e912a1c0b62f"
|
||||||
|
integrity sha512-yjRS5e4q008Q4DhsRqdjaqET/MfAQqTWuAxvv5pmnyT28vIDA8g6mlQf9l5gP3Aa/193Gqsy8w9IeijFHlTxJA==
|
||||||
|
dependencies:
|
||||||
|
"@nestjs/microservices" "^11.1.12"
|
||||||
|
protoc "33.4.0"
|
||||||
|
rxjs "^7.8.2"
|
||||||
|
ts-proto "2.11.0"
|
||||||
|
|
||||||
|
"@teacinema/contracts@^1.1.3":
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://git.ksv741.keenetic.pro/api/packages/teacinema/npm/%40teacinema%2Fcontracts/-/1.1.3/contracts-1.1.3.tgz#e08600a8dc09977dae35654d372e29e411029e33"
|
resolved "https://git.ksv741.keenetic.pro/api/packages/teacinema/npm/%40teacinema%2Fcontracts/-/1.1.3/contracts-1.1.3.tgz#e08600a8dc09977dae35654d372e29e411029e33"
|
||||||
integrity sha512-kwcSh2YIxmoBJQ56L+tQpGj12ySwNwf9KRNcUqhPffLPO60PR5aiKA2eN2SfKc23TKp0YoSkdC9LWeor0a9Ysg==
|
integrity sha512-kwcSh2YIxmoBJQ56L+tQpGj12ySwNwf9KRNcUqhPffLPO60PR5aiKA2eN2SfKc23TKp0YoSkdC9LWeor0a9Ysg==
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user