diff --git a/back/volume/src/chat/chat.service.ts b/back/volume/src/chat/chat.service.ts index 2b05397..daa8f31 100644 --- a/back/volume/src/chat/chat.service.ts +++ b/back/volume/src/chat/chat.service.ts @@ -1,4 +1,4 @@ -import { Inject, Injectable, NotFoundException } from '@nestjs/common' +import { Injectable, NotFoundException } from '@nestjs/common' import { InjectRepository } from '@nestjs/typeorm' import { Repository } from 'typeorm' @@ -69,7 +69,7 @@ export class ChatService { channel.muted = channel.muted.filter((data) => { return data[0] - Date.now() > 0 }) - this.ChannelRepository.save(channel) + void this.ChannelRepository.save(channel) }) } diff --git a/back/volume/src/users/users.controller.ts b/back/volume/src/users/users.controller.ts index e47c302..4ade093 100644 --- a/back/volume/src/users/users.controller.ts +++ b/back/volume/src/users/users.controller.ts @@ -17,9 +17,10 @@ import { import { FileInterceptor } from '@nestjs/platform-express' import { diskStorage } from 'multer' -import { type User } from './entity/user.entity' -import { UsersService } from './users.service' -import { UserDto, AvatarUploadDto } from './dto/user.dto' +import { type User } from "./entity/user.entity"; +import { UsersService } from "./users.service"; +import { UserDto, AvatarUploadDto } from "./dto/user.dto"; +import { PongService } from "src/pong/pong.service"; import { AuthenticatedGuard } from 'src/auth/42-auth.guard' import { Profile42 } from 'src/auth/42.decorator' @@ -36,20 +37,19 @@ export class UsersController { @Post('block/:id') @UseGuards(AuthenticatedGuard) - async blockUser ( - @Profile42() profile: Profile, - @Param('id', ParseIntPipe) id: number - ) { - const user = (await this.usersService.findUser(id)) as User + @Post("block/:id") + async blockUser(@Profile42() profile :Profile, @Param('id') id:number) { + const user = await this.usersService.findUser(id) as User user.blocked.push((await this.usersService.findUser(+profile.id)) as User) this.usersService.save(user) } @Post('unblock/:id') @UseGuards(AuthenticatedGuard) - async unblockUser (@Param('id', ParseIntPipe) id: number) { - const user = (await this.usersService.findUser(id)) as User - user.blocked = user.blocked.filter((usr: User) => { + @Post("unblock/:id") + async unblockUser(@Profile42() profile :Profile, @Param('id') id:number) { + const user = await this.usersService.findUser(id) as User + user.blocked = user.blocked.filter((usr: User) => { return usr.id !== id }) this.usersService.save(user) @@ -100,10 +100,10 @@ export class UsersController { } }) ) - @ApiConsumes('multipart/form-data') + @ApiConsumes("multipart/form-data") @ApiBody({ - description: 'A new avatar for the user', - type: AvatarUploadDto + description: "A new avatar for the user", + type: AvatarUploadDto, }) async changeAvatar ( @Profile42() profile: Profile, diff --git a/front/volume/package-lock.json b/front/volume/package-lock.json index ac2a7a8..fb262fc 100644 --- a/front/volume/package-lock.json +++ b/front/volume/package-lock.json @@ -18,7 +18,8 @@ }, "devDependencies": { "prettier": "^2.8.4", - "svelte-check": "^2.10.3" + "svelte-check": "^2.10.3", + "svelte-select": "^5.5.2" } }, "node_modules/@esbuild/android-arm": { @@ -351,6 +352,21 @@ "node": ">=12" } }, + "node_modules/@floating-ui/core": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.2.4.tgz", + "integrity": "sha512-SQOeVbMwb1di+mVWWJLpsUTToKfqVNioXys011beCAhyOIFtS+GQoW4EQSneuxzmQKddExDwQ+X0hLl4lJJaSQ==", + "dev": true + }, + "node_modules/@floating-ui/dom": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.4.tgz", + "integrity": "sha512-4+k+BLhtWj+peCU60gp0+rHeR8+Ohqx6kjJf/lHMnJ8JD5Qj6jytcq1+SZzRwD7rvHKRhR7TDiWWddrNrfwQLg==", + "dev": true, + "dependencies": { + "@floating-ui/core": "^1.2.3" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", @@ -1340,6 +1356,16 @@ "svelte": "^3.24.0" } }, + "node_modules/svelte-floating-ui": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/svelte-floating-ui/-/svelte-floating-ui-1.2.8.tgz", + "integrity": "sha512-8Ifi5CD2Ui7FX7NjJRmutFtXjrB8T/FMNoS2H8P81t5LHK4I9G4NIs007rLWG/nRl7y+zJUXa3tWuTjYXw/O5A==", + "dev": true, + "dependencies": { + "@floating-ui/core": "^1.1.0", + "@floating-ui/dom": "^1.1.0" + } + }, "node_modules/svelte-hmr": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.1.tgz", @@ -1426,6 +1452,16 @@ "sourcemap-codec": "^1.4.8" } }, + "node_modules/svelte-select": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/svelte-select/-/svelte-select-5.5.2.tgz", + "integrity": "sha512-uvTOJyrrD5OnSCAv9A+gLtIeeYHL5PUw3YpnuBkmfp7a3IHUyjgNNM4GIf462Lh9QEEEM3nD0R0E+G/Jp1iq1w==", + "dev": true, + "dependencies": { + "@floating-ui/dom": "^1.2.1", + "svelte-floating-ui": "1.2.8" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/front/volume/package.json b/front/volume/package.json index b42218d..e49ae72 100644 --- a/front/volume/package.json +++ b/front/volume/package.json @@ -12,7 +12,8 @@ }, "devDependencies": { "prettier": "^2.8.4", - "svelte-check": "^2.10.3" + "svelte-check": "^2.10.3", + "svelte-select": "^5.5.2" }, "dependencies": { "@sveltejs/vite-plugin-svelte": "^2.0.2", diff --git a/front/volume/src/components/Channels.svelte b/front/volume/src/components/Channels.svelte index 01c210f..3f6c4ee 100644 --- a/front/volume/src/components/Channels.svelte +++ b/front/volume/src/components/Channels.svelte @@ -1,4 +1,5 @@ +//--------------------------------------------------------------------------------/ -
+