Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export class ConnectionController {
@UseGuards(AuthGuard('jwt'))
async getConnection(@Query() queryDto: ConnectionQueryDto, @User() user: UserDto) {
const { type, id } = queryDto;

console.log('type:', type);
console.log('id:', id);
switch (type) {
case 'connection':
return await this.connectionService.getConnection(id as string, user.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export class ConnectionService {

async createGuestConnection() {
const connectionId = uuidv4();
await this.GeneralRedis.hset(connectionId, { type: 'guest' });
await Promise.all([
this.GeneralRedis.hset(connectionId, { type: 'guest', aiCount: 0, title: '제목없음' }),
this.GeneralRedis.set(`mindmapState:${connectionId}`, JSON.stringify({})),
this.GeneralRedis.set(`content:${connectionId}`, ''),
]);
return { connectionId, role: 'owner' };
}

Expand All @@ -39,7 +43,8 @@ export class ConnectionService {

async setConnection(mindmapId: number, userId: number) {
const role = await this.userService.getRole(userId, mindmapId);
if (!role) {
this.logger.log(`role: ${role}`);
if (role === undefined) {
throw new ForbiddenException('권한이 없습니다.');
}

Expand Down