fix(mobile): preserve assistant IDs and scope state
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export const normalizeBackendId = (value: string) => {
|
||||
const id = value.trim();
|
||||
if (!/^[1-9]\d*$/.test(id)) throw new Error('PERSONAL_ID_INVALID');
|
||||
return id;
|
||||
};
|
||||
|
||||
export const personalItemApiPath = (id: string, suffix = '') =>
|
||||
`/api/aihr/personal-assistant/items/${encodeURIComponent(normalizeBackendId(id))}${suffix}`;
|
||||
|
||||
export const personalSessionApiPath = (id: string) =>
|
||||
`/api/aihr/personal-assistant/sessions/${encodeURIComponent(normalizeBackendId(id))}`;
|
||||
|
||||
export const personalItemRoute = (id: string) =>
|
||||
`/pages/user/assistant/item?id=${encodeURIComponent(normalizeBackendId(id))}`;
|
||||
Reference in New Issue
Block a user