(resource: string)
| 83 | export const use = serviceUse(Service) |
| 84 | |
| 85 | function api(resource: string): Api { |
| 86 | return { |
| 87 | create: `/api/${resource}`, |
| 88 | sync: (shareID) => `/api/${resource}/${shareID}/sync`, |
| 89 | remove: (shareID) => `/api/${resource}/${shareID}`, |
| 90 | data: (shareID) => `/api/${resource}/${shareID}/data`, |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | const legacyApi = api("share") |
| 95 | const consoleApi = api("shares") |