Update logging
This commit is contained in:
parent
def602c05e
commit
810a333429
39 changed files with 85 additions and 139 deletions
|
|
@ -41,7 +41,6 @@ export const ZammadWrapper: FC<ZammadWrapperProps> = ({
|
|||
method: "GET",
|
||||
redirect: "manual",
|
||||
});
|
||||
console.log({ res });
|
||||
if (res.type === "opaqueredirect") {
|
||||
setAuthenticated(true);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -156,14 +156,12 @@ export const getTicketStatesAction = async () => {
|
|||
const states = await executeREST({
|
||||
path: "/api/v1/ticket_states",
|
||||
});
|
||||
console.log({ states });
|
||||
const formattedStates =
|
||||
states?.map((state: any) => ({
|
||||
value: `gid://zammad/Ticket::State/${state.id}`,
|
||||
label: state.name,
|
||||
disabled: ["new", "merged", "removed"].includes(state.name),
|
||||
})) ?? [];
|
||||
console.log({ formattedStates });
|
||||
return formattedStates;
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const getUserRoles = async (email: string) => {
|
|||
});
|
||||
return roles.filter((role: string) => role !== null);
|
||||
} catch (e) {
|
||||
console.log({ e });
|
||||
console.error({ e });
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,21 +13,18 @@ export const fetchLeafcutter = async (url: string, options: any) => {
|
|||
const json = await res.json();
|
||||
return json;
|
||||
} catch (error) {
|
||||
console.log({ error });
|
||||
console.error({ error });
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const data = await fetchData(url, options);
|
||||
console.log({ data });
|
||||
|
||||
if (!data) {
|
||||
const csrfURL = `${process.env.NEXT_PUBLIC_LEAFCUTTER_URL}/api/auth/csrf`;
|
||||
const csrfData = await fetchData(csrfURL, {});
|
||||
console.log({ csrfData });
|
||||
const authURL = `${process.env.NEXT_PUBLIC_LEAFCUTTER_URL}/api/auth/callback/credentials`;
|
||||
const authData = await fetchData(authURL, { method: "POST" });
|
||||
console.log({ authData });
|
||||
if (!authData) {
|
||||
return null;
|
||||
} else {
|
||||
|
|
@ -37,5 +34,3 @@ export const fetchLeafcutter = async (url: string, options: any) => {
|
|||
return data;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue