2023-09-06 15:14:50 +00:00
|
|
|
import axios from "axios"
|
|
|
|
|
|
|
|
const API = axios.create({
|
|
|
|
baseURL:"http://localhost:4000/api/",
|
|
|
|
headers: {
|
|
|
|
"Content-type": "application/json; charset=UTF-8"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
export const getSubmissions = async () => {
|
|
|
|
try {
|
2023-09-06 16:54:58 +00:00
|
|
|
const res = await API.get("submissions")
|
2023-09-06 15:14:50 +00:00
|
|
|
return res
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export const getStories = async () => {
|
|
|
|
try {
|
2023-09-06 16:54:58 +00:00
|
|
|
const res = await API.get("stories")
|
2023-09-06 15:14:50 +00:00
|
|
|
return res
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export const getPublications = async () => {
|
|
|
|
try {
|
2023-09-06 16:54:58 +00:00
|
|
|
const res = await API.get("publications")
|
2023-09-06 15:14:50 +00:00
|
|
|
return res
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
}
|
|
|
|
}
|