mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-19 16:05:01 +00:00
Reorganize project. Add folder for shared code between backend/dashboard. Switch from jest to ava for tests.
This commit is contained in:
parent
cd53d3ce5d
commit
9250c84637
162 changed files with 11056 additions and 9900 deletions
|
@ -1,38 +0,0 @@
|
|||
import { BaseGuildRepository } from "./BaseGuildRepository";
|
||||
import { getRepository, Repository } from "typeorm";
|
||||
import { SelfGrantableRole } from "./entities/SelfGrantableRole";
|
||||
|
||||
export class GuildSelfGrantableRoles extends BaseGuildRepository {
|
||||
private selfGrantableRoles: Repository<SelfGrantableRole>;
|
||||
|
||||
constructor(guildId) {
|
||||
super(guildId);
|
||||
this.selfGrantableRoles = getRepository(SelfGrantableRole);
|
||||
}
|
||||
|
||||
async getForChannel(channelId: string): Promise<SelfGrantableRole[]> {
|
||||
return this.selfGrantableRoles.find({
|
||||
where: {
|
||||
guild_id: this.guildId,
|
||||
channel_id: channelId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async delete(channelId: string, roleId: string) {
|
||||
await this.selfGrantableRoles.delete({
|
||||
guild_id: this.guildId,
|
||||
channel_id: channelId,
|
||||
role_id: roleId,
|
||||
});
|
||||
}
|
||||
|
||||
async add(channelId: string, roleId: string, aliases: string[]) {
|
||||
await this.selfGrantableRoles.insert({
|
||||
guild_id: this.guildId,
|
||||
channel_id: channelId,
|
||||
role_id: roleId,
|
||||
aliases,
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue