diff --git a/back/volume/src/main.ts b/back/volume/src/main.ts index 243ca57..ab171d8 100644 --- a/back/volume/src/main.ts +++ b/back/volume/src/main.ts @@ -7,6 +7,7 @@ import * as session from 'express-session' import * as passport from 'passport' import { type NestExpressApplication } from '@nestjs/platform-express' import * as cookieParser from 'cookie-parser' +import { Response } from 'express'; async function bootstrap () { const logger = new Logger() diff --git a/back/volume/src/users/dto/user.dto.ts b/back/volume/src/users/dto/user.dto.ts index a19571c..399dc2a 100644 --- a/back/volume/src/users/dto/user.dto.ts +++ b/back/volume/src/users/dto/user.dto.ts @@ -5,7 +5,7 @@ import { Express } from 'express' export class UserDto { @IsPositive() - @IsNotEmpty() + @IsOptional() readonly ftId: number @IsString() diff --git a/front/volume/public/img/profileicon.png b/front/volume/public/img/profileicon.png deleted file mode 100644 index bdd467f..0000000 Binary files a/front/volume/public/img/profileicon.png and /dev/null differ diff --git a/front/volume/src/components/Channels.svelte b/front/volume/src/components/Channels.svelte index 9de639a..6517bd9 100644 --- a/front/volume/src/components/Channels.svelte +++ b/front/volume/src/components/Channels.svelte @@ -3,6 +3,8 @@ export interface ChannelsType { id: string; name: string; + privacy: string; + password: string; messages: Array; } @@ -19,12 +21,27 @@ const createChannel = () => { const name = prompt("Enter a name for the new channel:"); if (name) { - const newChannel: ChannelsType = { - id: Math.random().toString(), - name, - messages: [] - }; - channels = [newChannel, ...channels]; + const privacy = prompt("Enter a privacy setting for the new channel (public/private):"); + if (privacy !== "public" && privacy !== "private") { + alert("Invalid privacy setting"); + } + let password = ""; + if (privacy === "private") { + password = prompt("Enter a password for the new channel:"); + if (!password) { + alert("Invalid password"); + } + } + if (privacy === "public" || password) { + const newChannel: ChannelsType = { + id: Math.random().toString(), + name, + privacy, + password, + messages: [] + }; + channels = [newChannel, ...channels]; + } } // TODO: save to database }; diff --git a/front/volume/src/components/Chat2.svelte b/front/volume/src/components/Chat2.svelte index 4ebf96a..fe2bc87 100644 --- a/front/volume/src/components/Chat2.svelte +++ b/front/volume/src/components/Chat2.svelte @@ -95,15 +95,4 @@ height: 200px; overflow-y: scroll; } - - .options-modal { - position: absolute; - top: 0; - left: 0; - background-color: white; - padding: 1rem; - border: 1px solid #ccc; - border-radius: 5px; - z-index: 9999; - } diff --git a/front/volume/src/components/NavBar.svelte b/front/volume/src/components/NavBar.svelte index 3fc53f9..84c00de 100644 --- a/front/volume/src/components/NavBar.svelte +++ b/front/volume/src/components/NavBar.svelte @@ -1,4 +1,5 @@ +