🐛 (fix) handle the fetch error
This commit is contained in:
@ -2,8 +2,12 @@
|
|||||||
import { api } from "@/shared/api/connector";
|
import { api } from "@/shared/api/connector";
|
||||||
|
|
||||||
const getOauthProviderList = async () => {
|
const getOauthProviderList = async () => {
|
||||||
|
try {
|
||||||
const res = await api.get(`auth/providers`);
|
const res = await api.get(`auth/providers`);
|
||||||
return res.json();
|
return res.json();
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error("Failed to fetch OAuth providers", { cause: error });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default getOauthProviderList;
|
export default getOauthProviderList;
|
||||||
|
|||||||
Reference in New Issue
Block a user