Skip to content

Commit

Permalink
fix signature type
Browse files Browse the repository at this point in the history
  • Loading branch information
Willyfrog committed Feb 19, 2025
1 parent d74c0af commit 51f036b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/actions/remote/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ export const getAllSupportedTimezones = async (serverUrl: string) => {
}
};

export const fetchCustomAttributes = async (serverUrl: string, userId: string) => {
export const fetchCustomAttributes = async (serverUrl: string, userId: string): Promise<{attributes: CustomAttributeSet; error: unknown}> => {
try {
const client = NetworkManager.getClient(serverUrl);
const [fields, attrValues] = await Promise.all([
Expand All @@ -897,17 +897,17 @@ export const fetchCustomAttributes = async (serverUrl: string, userId: string) =
value: attrValues[field.id] || '',
};
});
return {attributes, undefined};
return {attributes, error: undefined};
}
return {attributes: {} as Record<string, CustomAttribute>};
return {attributes: {} as Record<string, CustomAttribute>, error: undefined};
} catch (error) {
logDebug('error on fetchCustomAttributes', getFullErrorMessage(error));
forceLogoutIfNecessary(serverUrl, error);
return {attributes: {} as Record<string, CustomAttribute>, error};
}
};

export const updateCustomAttributes = async (serverUrl: string, attributes: CustomAttributeSet) => {
export const updateCustomAttributes = async (serverUrl: string, attributes: CustomAttributeSet): Promise<{success: boolean; error: unknown}> => {
try {
const client = NetworkManager.getClient(serverUrl);
const values: CustomProfileAttributeSimple = {};
Expand Down

0 comments on commit 51f036b

Please sign in to comment.