mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-12 06:40:57 +04:30
Initial commit: Meshkee dashboards monorepo.
Includes business, customer, and super-admin apps with shared packages and production deploy scripts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import { apiRequest } from '../lib/api'
|
||||
|
||||
export interface UserAddress {
|
||||
id: string
|
||||
label: string | null
|
||||
province: string
|
||||
city: string
|
||||
address: string
|
||||
postalCode: string | null
|
||||
landline: string | null
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
export interface UserAddressInput {
|
||||
label?: string
|
||||
province: string
|
||||
city: string
|
||||
address: string
|
||||
postalCode?: string
|
||||
landline?: string
|
||||
}
|
||||
|
||||
export async function listAddresses(signal?: AbortSignal) {
|
||||
return apiRequest<{ items: UserAddress[] }>('/auth/addresses', { auth: true, signal })
|
||||
}
|
||||
|
||||
export async function createAddress(input: UserAddressInput) {
|
||||
return apiRequest<{ address: UserAddress }>('/auth/addresses', {
|
||||
method: 'POST',
|
||||
auth: true,
|
||||
body: input,
|
||||
})
|
||||
}
|
||||
|
||||
export async function updateAddress(addressId: string, input: UserAddressInput) {
|
||||
return apiRequest<{ address: UserAddress }>(`/auth/addresses/${addressId}`, {
|
||||
method: 'PATCH',
|
||||
auth: true,
|
||||
body: input,
|
||||
})
|
||||
}
|
||||
|
||||
export async function removeAddress(addressId: string) {
|
||||
return apiRequest<{ message: string }>(`/auth/addresses/${addressId}`, {
|
||||
method: 'DELETE',
|
||||
auth: true,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user