Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/cli-kit/src/public/node/themes/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ export function themePreviewUrl(theme: Theme, session: AdminSession) {
}

export function themeEditorUrl(theme: Theme, session: AdminSession) {
const store = session.storeFqdn
return `https://${store}/admin/themes/${theme.id}/editor`
return adminUrl(session.storeFqdn, `/themes/${theme.id}/editor`)
}

export function codeEditorUrl(theme: Theme, session: AdminSession) {
const store = session.storeFqdn
return `https://${store}/admin/themes/${theme.id}`
return adminUrl(session.storeFqdn, `/themes/${theme.id}`)
}

export function storeAdminUrl(session: AdminSession) {
const store = session.storeFqdn
return `https://${store}/admin`
return adminUrl(session.storeFqdn)
}

export function storePasswordPage(store: AdminSession['storeFqdn']) {
return `https://${store}/admin/online_store/preferences`
return adminUrl(store, '/online_store/preferences')
}

function adminUrl(store: string, path = ''): string {
return `https://${store}/admin${path}`
}
Loading