mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
Multitenancy
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { apiClient } from './client'
|
||||
import type { TenantResponse, TenantCreateRequest, TenantUpdateRequest } from '@/types/api.types'
|
||||
|
||||
export const tenantsApi = {
|
||||
list(): Promise<TenantResponse[]> {
|
||||
return apiClient.get<TenantResponse[]>('/tenants').then((r) => r.data)
|
||||
},
|
||||
|
||||
get(id: string): Promise<TenantResponse> {
|
||||
return apiClient.get<TenantResponse>(`/tenants/${id}`).then((r) => r.data)
|
||||
},
|
||||
|
||||
create(data: TenantCreateRequest): Promise<TenantResponse> {
|
||||
return apiClient.post<TenantResponse>('/tenants', data).then((r) => r.data)
|
||||
},
|
||||
|
||||
update(id: string, data: TenantUpdateRequest): Promise<TenantResponse> {
|
||||
return apiClient.patch<TenantResponse>(`/tenants/${id}`, data).then((r) => r.data)
|
||||
},
|
||||
|
||||
suspend(id: string): Promise<TenantResponse> {
|
||||
return apiClient.patch<TenantResponse>(`/tenants/${id}`, { is_active: false }).then((r) => r.data)
|
||||
},
|
||||
|
||||
activate(id: string): Promise<TenantResponse> {
|
||||
return apiClient.patch<TenantResponse>(`/tenants/${id}`, { is_active: true }).then((r) => r.data)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user