Fix /users/@me/settings get and migrarion
This commit is contained in:
parent
7ce8543510
commit
c7767e5fa4
@ -4,13 +4,13 @@ import { route } from "@fosscord/api";
|
||||
|
||||
const router = Router();
|
||||
|
||||
export interface UserSettingsSchema extends Partial<UserSettings> {}
|
||||
export interface UserSettingsSchema extends Partial<UserSettings> { }
|
||||
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
const user = await User.findOneOrFail(
|
||||
{ id: req.user_id },
|
||||
{ relations: ["settings"] }
|
||||
)
|
||||
{ select: ["settings"] }
|
||||
);
|
||||
return res.json(user.settings);
|
||||
});
|
||||
|
||||
|
@ -8,9 +8,15 @@ export class mobileFixes21660689892073 implements MigrationInterface {
|
||||
ALTER TABLE \`user_settings\`
|
||||
ADD \`banner_color\` varchar(255) NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
UPDATE \`channels\` SET \`nsfw\` = 0 WHERE \`nsfw\` = NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`channels\` CHANGE \`nsfw\` \`nsfw\` tinyint NOT NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
UPDATE \`guilds\` SET \`nsfw\` = 0 WHERE \`nsfw\` = NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`guilds\` CHANGE \`nsfw\` \`nsfw\` tinyint NOT NULL
|
||||
`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user