fix: return user profile theme colors as numbers
This commit is contained in:
parent
c51595a6da
commit
a11f3c0409
14
.eslintrc
14
.eslintrc
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"plugins": ["@typescript-eslint"],
|
|
||||||
"root": true,
|
|
||||||
"rules": {
|
|
||||||
"no-mixed-spaces-and-tabs": "off",
|
|
||||||
"@typescript-eslint/no-inferrable-types": "off", // Required by typeorm
|
|
||||||
"@typescript-eslint/no-var-requires": "off" // Sometimes requred by typeorm to resolve circular deps
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
45
eslint.config.mjs
Normal file
45
eslint.config.mjs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
||||||
|
import globals from "globals";
|
||||||
|
import tsParser from "@typescript-eslint/parser";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import js from "@eslint/js";
|
||||||
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname,
|
||||||
|
recommendedConfig: js.configs.recommended,
|
||||||
|
allConfig: js.configs.all
|
||||||
|
});
|
||||||
|
|
||||||
|
export default [{
|
||||||
|
ignores: [
|
||||||
|
"**/node_modules",
|
||||||
|
"**/dist",
|
||||||
|
"**/README.md",
|
||||||
|
"**/COPYING",
|
||||||
|
"src/webrtc",
|
||||||
|
"**/scripts/",
|
||||||
|
"**/assets",
|
||||||
|
],
|
||||||
|
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
|
||||||
|
plugins: {
|
||||||
|
"@typescript-eslint": typescriptEslint,
|
||||||
|
},
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
|
||||||
|
parser: tsParser,
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
"no-mixed-spaces-and-tabs": "off",
|
||||||
|
"@typescript-eslint/no-inferrable-types": "off",
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
|
},
|
||||||
|
}];
|
||||||
BIN
package-lock.json
generated
BIN
package-lock.json
generated
Binary file not shown.
@ -38,6 +38,8 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://spacebar.chat",
|
"homepage": "https://spacebar.chat",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/eslintrc": "^3.1.0",
|
||||||
|
"@eslint/js": "^9.14.0",
|
||||||
"@types/amqplib": "^0.10.5",
|
"@types/amqplib": "^0.10.5",
|
||||||
"@types/bcrypt": "^5.0.2",
|
"@types/bcrypt": "^5.0.2",
|
||||||
"@types/body-parser": "^1.19.5",
|
"@types/body-parser": "^1.19.5",
|
||||||
@ -61,6 +63,7 @@
|
|||||||
"@typescript-eslint/parser": "^8.12.2",
|
"@typescript-eslint/parser": "^8.12.2",
|
||||||
"eslint": "^9.13.0",
|
"eslint": "^9.13.0",
|
||||||
"express": "^4.21.1",
|
"express": "^4.21.1",
|
||||||
|
"globals": "^15.12.0",
|
||||||
"husky": "^9.1.6",
|
"husky": "^9.1.6",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"pretty-quick": "^4.0.0",
|
"pretty-quick": "^4.0.0",
|
||||||
|
|||||||
@ -82,7 +82,7 @@ router.get(
|
|||||||
? await Member.findOneOrFail({
|
? await Member.findOneOrFail({
|
||||||
where: { id: req.params.id, guild_id: guild_id },
|
where: { id: req.params.id, guild_id: guild_id },
|
||||||
relations: ["roles"],
|
relations: ["roles"],
|
||||||
})
|
})
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
// TODO: make proper DTO's in util?
|
// TODO: make proper DTO's in util?
|
||||||
@ -92,7 +92,7 @@ router.get(
|
|||||||
accent_color: user.accent_color,
|
accent_color: user.accent_color,
|
||||||
banner: user.banner,
|
banner: user.banner,
|
||||||
pronouns: user.pronouns,
|
pronouns: user.pronouns,
|
||||||
theme_colors: user.theme_colors,
|
theme_colors: user.theme_colors?.map((t) => Number(t)), // these are strings for some reason, they should be numbers
|
||||||
};
|
};
|
||||||
|
|
||||||
const guildMemberProfile = {
|
const guildMemberProfile = {
|
||||||
|
|||||||
Reference in New Issue
Block a user