diff --git a/backend/src/data/GuildArchives.ts b/backend/src/data/GuildArchives.ts index 3b5742b8..b9ae4c05 100644 --- a/backend/src/data/GuildArchives.ts +++ b/backend/src/data/GuildArchives.ts @@ -11,8 +11,8 @@ import { guildToTemplateSafeGuild, userToTemplateSafeUser, } from "../utils/templateSafeObjects"; -import { decryptJson, encryptJson } from "../utils/cryptHelpers"; import { SavedMessage } from "./entities/SavedMessage"; +import { decrypt, encrypt } from "../utils/crypt"; const DEFAULT_EXPIRY_DAYS = 30; @@ -35,13 +35,13 @@ export class GuildArchives extends BaseGuildRepository { return entity; } - entity.body = await decryptJson(entity.body as unknown as string); + entity.body = await decrypt(entity.body); return entity; } protected async _processEntityToDB(entity: Partial) { if (entity.body) { - entity.body = (await encryptJson(entity.body)) as any; + entity.body = await encrypt(entity.body); } return entity; }