Add website sitemap config sync to business dashboard settings.
Lets business owners import static pages and URL templates from the live storefront manifest before API sitemap generation. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
d5aca8bea7
commit
5926f772e2
@@ -0,0 +1,27 @@
|
||||
import { apiRequest } from '../lib/api'
|
||||
import { getActiveBusinessId } from '../lib/businessContext'
|
||||
|
||||
export interface WebsiteSitemapConfig {
|
||||
baseUrl?: string | null
|
||||
staticPages?: Array<{
|
||||
path: string
|
||||
changefreq?: string
|
||||
priority?: number
|
||||
}>
|
||||
templates?: Record<string, string>
|
||||
syncedAt?: string | null
|
||||
}
|
||||
|
||||
function businessPath(suffix: string) {
|
||||
const businessId = getActiveBusinessId()
|
||||
return `/businesses/${businessId}/website/sitemap${suffix}`
|
||||
}
|
||||
|
||||
export async function syncWebsiteSitemapConfig() {
|
||||
return apiRequest<{
|
||||
message: string
|
||||
sitemapConfig: WebsiteSitemapConfig
|
||||
}>(businessPath('/sync'), {
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user