21 lines
531 B
TypeScript
21 lines
531 B
TypeScript
import axios from "axios";
|
|
import { CookieValueTypes } from "cookies-next";
|
|
|
|
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
|
|
|
// Get Category
|
|
export async function getCategory({ token }: { token: CookieValueTypes }) {
|
|
const data = await axios.get("api/Common/Categories", {
|
|
headers: {
|
|
Authorization: `Bearer ${token}`,
|
|
},
|
|
});
|
|
return data.data;
|
|
}
|
|
|
|
// Get Captcha
|
|
export async function getCaptcha() {
|
|
const data = await axios.get("api/Common/Captcha", { responseType: "blob" });
|
|
return data;
|
|
}
|