feat(api): add create and update functionality for charge points with registration status
This commit is contained in:
@@ -99,8 +99,24 @@ export const api = {
|
||||
chargePoints: {
|
||||
list: () => apiFetch<ChargePoint[]>("/api/charge-points"),
|
||||
get: (id: number) => apiFetch<ChargePoint>(`/api/charge-points/${id}`),
|
||||
update: (id: string, data: { feePerKwh: number }) =>
|
||||
apiFetch<{ feePerKwh: number }>(`/api/charge-points/${id}`, {
|
||||
create: (data: {
|
||||
chargePointIdentifier: string;
|
||||
chargePointVendor?: string;
|
||||
chargePointModel?: string;
|
||||
registrationStatus?: "Accepted" | "Pending" | "Rejected";
|
||||
feePerKwh?: number;
|
||||
}) =>
|
||||
apiFetch<ChargePoint>("/api/charge-points", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
}),
|
||||
update: (id: string, data: {
|
||||
feePerKwh?: number;
|
||||
registrationStatus?: "Accepted" | "Pending" | "Rejected";
|
||||
chargePointVendor?: string;
|
||||
chargePointModel?: string;
|
||||
}) =>
|
||||
apiFetch<ChargePoint>(`/api/charge-points/${id}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(data),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user