From 7e55cb9355ebadb05402dd201192f2df3e22073f Mon Sep 17 00:00:00 2001 From: "James A. Manon-og" Date: Fri, 23 Jan 2026 01:59:30 +0800 Subject: [PATCH] fix: add email to organization data response and correct parameter formatting --- lib/api/services/organizationServices.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/api/services/organizationServices.ts b/lib/api/services/organizationServices.ts index 64b8416..bd3fc67 100644 --- a/lib/api/services/organizationServices.ts +++ b/lib/api/services/organizationServices.ts @@ -57,7 +57,7 @@ export const findAllByOrganizationParent = async ( params?: { page?: number; limit?: number; - } + }, ) => { const queryParams = new URLSearchParams({ page: (params?.page || 1).toString(), @@ -69,7 +69,7 @@ export const findAllByOrganizationParent = async ( { method: "GET", credentials: "include", - } + }, ); if (!response.ok) { @@ -91,11 +91,17 @@ export const findOneOrganization = async (id: string) => { } const data = await response.json(); + if (data.user?.email) { + return { + ...data, + email: data.user.email, + }; + } return data; }; export const createOrganization = async ( - orgData: CreateOrganizationRequest + orgData: CreateOrganizationRequest, ) => { const response = await fetch(`${BASE_URL}/organizations`, { method: "POST", @@ -116,7 +122,7 @@ export const createOrganization = async ( export const updateOrganization = async ( id: string, - orgData: Partial + orgData: Partial, ) => { const response = await fetch(`${BASE_URL}/organizations/${id}`, { method: "PATCH",