Update server owner dashboard permissions automatically
This commit is contained in:
parent
971ec0de6c
commit
48c4b3578d
9 changed files with 144 additions and 21 deletions
|
@ -2,6 +2,8 @@ import { getRepository, Repository } from "typeorm";
|
|||
import { ApiPermissionTypes } from "./ApiPermissionAssignments";
|
||||
import { BaseRepository } from "./BaseRepository";
|
||||
import { AllowedGuild } from "./entities/AllowedGuild";
|
||||
import moment from "moment-timezone";
|
||||
import { DBDateFormat } from "../utils";
|
||||
|
||||
export class AllowedGuilds extends BaseRepository {
|
||||
private allowedGuilds: Repository<AllowedGuild>;
|
||||
|
@ -37,7 +39,10 @@ export class AllowedGuilds extends BaseRepository {
|
|||
}
|
||||
|
||||
updateInfo(id, name, icon, ownerId) {
|
||||
return this.allowedGuilds.update({ id }, { name, icon, owner_id: ownerId });
|
||||
return this.allowedGuilds.update(
|
||||
{ id },
|
||||
{ name, icon, owner_id: ownerId, updated_at: moment.utc().format(DBDateFormat) },
|
||||
);
|
||||
}
|
||||
|
||||
add(id, data: Partial<Omit<AllowedGuild, "id">> = {}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue