Skip to content
Snippets Groups Projects
Commit 6283774c authored by Timothee P's avatar Timothee P :sunflower:
Browse files

prevent this.USER_LEVEL_PROJECTS from being null

parent 1b199909
No related branches found
No related tags found
1 merge request!62REDMINE_ISSUE-11886
......@@ -206,9 +206,10 @@ export default {
return null;
},
isAdmin: function () {
return (
return this.USER_LEVEL_PROJECTS &&
this.USER_LEVEL_PROJECTS[this.project.slug] === "Administrateur projet"
);
? true
: false;
},
},
......
import axios from 'axios';
import store from '../store'
const baseUrl = store.state.configuration.VUE_APP_DJANGO_API_BASE;
const mapAPI = {
async postOrPut({ basemap, projectSlug, newBasemapIds }) {
basemap["project"] = projectSlug
if (newBasemapIds.includes(basemap.id)) {
return axios
.post(`${baseUrl}base-maps/`, basemap)
.then((response) => response)
.catch((error) => {
throw error;
});
} else {
return axios
.put(`${baseUrl}base-maps/${basemap.id}/`, basemap)
.then((response) => response)
.catch((error) => {
throw error;
});
}
}
}
export default mapAPI;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment