Skip to content

Commit

Permalink
feat - auto sail get route
Browse files Browse the repository at this point in the history
  • Loading branch information
jaga-live committed Dec 25, 2023
1 parent 867d688 commit 2ebd1b0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/modules/auto-sail/auto-sail.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Body,
Controller,
Get,
Inject,
Param,
Patch,
Expand All @@ -24,6 +25,13 @@ export class AutoSailController {
@Inject(AutoSailService) private readonly autoSailService: AutoSailService,
) {}

@UseGuards(AuthGuard, GuildAccess)
@GuildRoles(ROLES.GUILD_OWNER, ROLES.GUILD_ADMIN)
@Get()
async get(@ExtractContext() { guildId }: UserRequestContext) {
return this.autoSailService.get(guildId);
}

@UseGuards(AuthGuard, GuildAccess)
@GuildRoles(ROLES.GUILD_OWNER, ROLES.GUILD_ADMIN)
@Post()
Expand Down
4 changes: 4 additions & 0 deletions src/modules/auto-sail/auto-sail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export class AutoSailService {
@Inject(RedisService) private readonly redisService: RedisService,
) {}

async get(guildId: string) {
return this.autoSailModel.find({ guildId });
}

async create(
guildId: string,
userId: string,
Expand Down
4 changes: 2 additions & 2 deletions src/modules/language/dto/language_filter.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class LanguageFilterTriggerAction {

@IsNotEmpty()
@ValidateIf((o) => o.action === DiscordActions.MESSAGE_REACT)
public reactEmoji: string;
public emoji: string;

@IsNotEmpty()
@ValidateIf((o) => o.action === DiscordActions.MESSAGE_REACT)
public replyMessage: string;
public plainMessage: string;
}

class LanguageFilterConfig {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/language/dto/strong_language.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class StrongLanguageTriggerAction {

@IsNotEmpty()
@ValidateIf((o) => o.action === DiscordActions.MESSAGE_REACT)
public reactEmoji: string;
public emoji: string;

@IsNotEmpty()
@ValidateIf((o) => o.action === DiscordActions.MESSAGE_REPLY)
public replyMessage: string;
public plainMessage: string;
}

class StrongLanguageConfig {
Expand Down

0 comments on commit 2ebd1b0

Please sign in to comment.