import axios from "axios"; import { API_TOKEN, SERVER_URL } from "../App"; import { viewPermissionType } from "../shared/models/variables"; export const getShelfDetails = async (categoryId: string) => { return await axios.get(SERVER_URL + '/shelf/details/?_id=' + categoryId, { headers: API_TOKEN }) } export const addShelf = async (categoryId: string, name: string, isArchived: boolean, viewType: viewPermissionType, description?: string) => { return await axios.post(SERVER_URL + '/shelf/add/', { categoryId: categoryId, name: name, description: description, isArchived: isArchived, viewType: viewType }, { headers: API_TOKEN }) } //Need to be discussed export const updateShelf = async (id: string, word: string, isArchived: boolean, spaceBetweenRecall: number) => { return await axios.put(SERVER_URL + '/shelf/update/', { id: id, words: [{ word: word, notes: [], isArchived: isArchived, spaceBetweenRecall: spaceBetweenRecall }] }, { headers: API_TOKEN }) }