mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-25 14:24:24 +00:00
chore: update frontend folder
This commit is contained in:
14
frontend/extension/src/helpers/api.ts
Normal file
14
frontend/extension/src/helpers/api.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Storage } from "@plasmohq/storage";
|
||||
import axios from "axios";
|
||||
|
||||
const storage = new Storage();
|
||||
|
||||
export const getUrlFavicon = async (url: string) => {
|
||||
const domain = await storage.getItem<string>("domain");
|
||||
const accessToken = await storage.getItem<string>("access_token");
|
||||
return axios.get<string>(`${domain}/api/v1/url/favicon?url=${url}`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
});
|
||||
};
|
5
frontend/extension/src/helpers/utils.ts
Normal file
5
frontend/extension/src/helpers/utils.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { isNull, isUndefined } from "lodash-es";
|
||||
|
||||
export const isNullorUndefined = (value: any) => {
|
||||
return isNull(value) || isUndefined(value);
|
||||
};
|
Reference in New Issue
Block a user