Skip to content

Commit

Permalink
fix: save hex symbol with color name (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Feb 5, 2025
1 parent e4430fa commit 3eab75e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
5 changes: 1 addition & 4 deletions src/graphql/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,8 @@ export function checkLimits(args: any = {}, type) {

function formatSkinSettings(result) {
return SKIN_SETTINGS.reduce((acc, colorName) => {
if (!result[colorName]) return acc;
acc[colorName] = result[colorName];

acc[colorName] = `${colorName.includes('_color') ? '#' : ''}${
result[colorName]
}`;
return acc;
}, {});
}
Expand Down
16 changes: 8 additions & 8 deletions src/helpers/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ CREATE TABLE options (

CREATE TABLE skins (
id VARCHAR(100) NOT NULL,
bg_color VARCHAR(6) DEFAULT NULL,
link_color VARCHAR(6) DEFAULT NULL,
text_color VARCHAR(6) DEFAULT NULL,
content_color VARCHAR(6) DEFAULT NULL,
border_color VARCHAR(6) DEFAULT NULL,
heading_color VARCHAR(6) DEFAULT NULL,
primary_color VARCHAR(6) DEFAULT NULL,
header_color VARCHAR(6) DEFAULT NULL,
bg_color VARCHAR(7) DEFAULT NULL,
link_color VARCHAR(7) DEFAULT NULL,
text_color VARCHAR(7) DEFAULT NULL,
content_color VARCHAR(7) DEFAULT NULL,
border_color VARCHAR(7) DEFAULT NULL,
heading_color VARCHAR(7) DEFAULT NULL,
primary_color VARCHAR(7) DEFAULT NULL,
header_color VARCHAR(7) DEFAULT NULL,
theme VARCHAR(5) NOT NULL DEFAULT 'light',
logo VARCHAR(256) DEFAULT NULL,
PRIMARY KEY (id)
Expand Down

0 comments on commit 3eab75e

Please sign in to comment.