Skip to content

Commit

Permalink
fix: save hex symbol with color name
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Feb 5, 2025
1 parent f5bcebb commit 95f0579
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/graphql/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,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
14 changes: 7 additions & 7 deletions src/helpers/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ 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,
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,
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',
PRIMARY KEY (id)
);
Expand Down

0 comments on commit 95f0579

Please sign in to comment.