fixed error loading posts when not logged in

This commit is contained in:
2024-06-11 20:59:41 +02:00
parent 36ca8c76d3
commit 8287b72e60

View File

@@ -6,9 +6,11 @@ const path = "https://api.jodel.anxietyprime.de/post";
export const postApi = { export const postApi = {
async getPostsByCoords (lon, lat) { async getPostsByCoords (lon, lat) {
if (!keycloak.authenticated) return [];
return (await axios.get(`${path}s/${lon}/${lat}`)).data; return (await axios.get(`${path}s/${lon}/${lat}`)).data;
}, },
async getPostByID (id) { async getPostByID (id) {
if (!keycloak.authenticated) return [];
return (await axios.get(`${path}/${id}`)).data; return (await axios.get(`${path}/${id}`)).data;
}, },
async createNewPost(title, content, parent = null) { async createNewPost(title, content, parent = null) {