사이트 광고 슬롯 설정 추가
This commit is contained in:
@@ -124,6 +124,10 @@ const mapSiteSettingsRow = (row) => ({
|
||||
adsTxt: row.ads_txt || '',
|
||||
customHeadCode: row.custom_head_code || '',
|
||||
customFooterCode: row.custom_footer_code || '',
|
||||
adHomeFeedCode: row.ad_home_feed_code || '',
|
||||
adSidebarCode: row.ad_sidebar_code || '',
|
||||
adPostTopCode: row.ad_post_top_code || '',
|
||||
adPostBottomCode: row.ad_post_bottom_code || '',
|
||||
updatedAt: row.updated_at.toISOString()
|
||||
})
|
||||
|
||||
@@ -894,6 +898,10 @@ export const updateSiteSettings = async (input) => {
|
||||
ads_txt,
|
||||
custom_head_code,
|
||||
custom_footer_code,
|
||||
ad_home_feed_code,
|
||||
ad_sidebar_code,
|
||||
ad_post_top_code,
|
||||
ad_post_bottom_code,
|
||||
updated_at
|
||||
)
|
||||
VALUES (
|
||||
@@ -921,6 +929,10 @@ export const updateSiteSettings = async (input) => {
|
||||
${input.adsTxt || ''},
|
||||
${input.customHeadCode || ''},
|
||||
${input.customFooterCode || ''},
|
||||
${input.adHomeFeedCode || ''},
|
||||
${input.adSidebarCode || ''},
|
||||
${input.adPostTopCode || ''},
|
||||
${input.adPostBottomCode || ''},
|
||||
now()
|
||||
)
|
||||
ON CONFLICT (id) DO UPDATE
|
||||
@@ -948,6 +960,10 @@ export const updateSiteSettings = async (input) => {
|
||||
ads_txt = EXCLUDED.ads_txt,
|
||||
custom_head_code = EXCLUDED.custom_head_code,
|
||||
custom_footer_code = EXCLUDED.custom_footer_code,
|
||||
ad_home_feed_code = EXCLUDED.ad_home_feed_code,
|
||||
ad_sidebar_code = EXCLUDED.ad_sidebar_code,
|
||||
ad_post_top_code = EXCLUDED.ad_post_top_code,
|
||||
ad_post_bottom_code = EXCLUDED.ad_post_bottom_code,
|
||||
updated_at = now()
|
||||
RETURNING *
|
||||
`
|
||||
|
||||
@@ -45,7 +45,11 @@ export const adminSiteSettingsInputSchema = z.object({
|
||||
).max(MAX_SIGNUP_BLOCKED_USERNAME_COUNT).optional().default([...DEFAULT_SIGNUP_BLOCKED_USERNAMES]),
|
||||
adsTxt: z.string().max(20000).optional().default(''),
|
||||
customHeadCode: z.string().max(50000).optional().default(''),
|
||||
customFooterCode: z.string().max(50000).optional().default('')
|
||||
customFooterCode: z.string().max(50000).optional().default(''),
|
||||
adHomeFeedCode: z.string().max(50000).optional().default(''),
|
||||
adSidebarCode: z.string().max(50000).optional().default(''),
|
||||
adPostTopCode: z.string().max(50000).optional().default(''),
|
||||
adPostBottomCode: z.string().max(50000).optional().default('')
|
||||
}).superRefine((data, ctx) => {
|
||||
if (!isValidAnnouncementBackgroundColor(data.announcementBackgroundColor)) {
|
||||
ctx.addIssue({
|
||||
|
||||
@@ -37,6 +37,10 @@ export const getDefaultSiteSettings = () => {
|
||||
adsTxt: '',
|
||||
customHeadCode: '',
|
||||
customFooterCode: '',
|
||||
adHomeFeedCode: '',
|
||||
adSidebarCode: '',
|
||||
adPostTopCode: '',
|
||||
adPostBottomCode: '',
|
||||
updatedAt: null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user