fix: remittances totalAmount+clientId (FIBEROPS-221), create client URL (FIBEROPS-222), tickets /messages (FIBEROPS-224)
This commit is contained in:
@@ -60,11 +60,11 @@ export default function ClientsPage() {
|
||||
|
||||
const createClient = useMutation({
|
||||
mutationFn: async () => {
|
||||
const res = await api.post("/api/v1/clients/onboard", {
|
||||
const res = await api.post("/api/v1/clients", {
|
||||
firstName: form.firstName, lastName: form.lastName,
|
||||
email: form.email, phone: form.phone, address: form.address,
|
||||
areaId: form.areaId || undefined, planId: form.planId,
|
||||
billingType: form.billingType,
|
||||
areaId: form.areaId || undefined,
|
||||
planId: form.planId || undefined,
|
||||
});
|
||||
return res.data;
|
||||
},
|
||||
@@ -73,7 +73,7 @@ export default function ClientsPage() {
|
||||
qc.invalidateQueries({ queryKey: ["clients"] });
|
||||
setShowAdd(false);
|
||||
setForm({ firstName: "", lastName: "", email: "", phone: "", address: "", areaId: "", planId: "", billingType: "POSTPAID" });
|
||||
if (data?.client?.id) router.push(`/clients/${data.client.id}`);
|
||||
if (data?.id) router.push(`/clients/${data.id}`);
|
||||
},
|
||||
onError: (e: any) => toast.error(e.response?.data?.message ?? "Failed to create client"),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user