rider partner page
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/** Tenant and branch endpoints — the Nearle Admin's provisioning surface. */
|
||||
|
||||
import { api, WEB } from './client';
|
||||
import type { AppLocation } from './deliveries';
|
||||
import type { TenantInfo, TenantLocation } from './types';
|
||||
|
||||
/** Everything the tenant-onboarding form collects. */
|
||||
@@ -172,6 +173,19 @@ export const tenantsApi = {
|
||||
updateProfile: (body: { tenantid: number } & Partial<TenantInfo>) =>
|
||||
api.put<unknown>(`${WEB}/tenants/updatetenant`, body),
|
||||
|
||||
/**
|
||||
* Which delivery partner supplies this merchant's riders.
|
||||
*
|
||||
* Its own endpoint, not a field on `updateProfile`: `partnerid` is kept out
|
||||
* of the merchant-editable allowlist on purpose, because a merchant who could
|
||||
* set it would move themselves under another partner's riders and billing.
|
||||
*
|
||||
* `partnerid: 0` is a real instruction — it means "this merchant uses their
|
||||
* own riders" — and the server reads it as sent rather than as absent.
|
||||
*/
|
||||
assignPartner: (tenantid: number, partnerid: number) =>
|
||||
api.put<unknown>(`${WEB}/tenants/assignpartner`, { tenantid, partnerid }),
|
||||
|
||||
/**
|
||||
* One business, by id — how a store login reads its own record.
|
||||
*
|
||||
@@ -267,4 +281,14 @@ export const utilsApi = {
|
||||
* invisible to onboarding until someone edits the frontend.
|
||||
*/
|
||||
appCategories: () => api.list<AppCategory>(`${WEB}/utils/getappcategories`),
|
||||
|
||||
/**
|
||||
* The delivery regions — Coimbatore, Madurai, Nagercoil today.
|
||||
*
|
||||
* `applocationid` is REQUIRED by the handler and 0 is how you ask for all of
|
||||
* them; omitting it answers 400 "Invalid applocationid", which reads as a
|
||||
* broken request rather than a missing default.
|
||||
*/
|
||||
appLocations: (applocationid = 0) =>
|
||||
api.list<AppLocation>(`${WEB}/utils/getapplocations`, { applocationid }),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user