Files
AnimeTV-Frontend/features/auth/lib/getOauthProviderList.ts
Rafi Arrafif 6d5fee823e 👌 (review) update connector error handling
Improve error handling by creating a function handler for connections on servers that use KY, and use the status key in
the response as the key to success instead of catch. Use catch if an error occurs between the client and server, not
between the server and backend.
2025-09-13 12:50:43 +07:00

14 lines
326 B
TypeScript

"use server";
import { api } from "@/shared/lib/ky/connector";
const getOauthProviderList = async () => {
try {
const res = await api.get(`auth/providers`);
return res.json();
} catch (error) {
throw new Error("Failed to fetch OAuth providers", { cause: error });
}
};
export default getOauthProviderList;