import Api from '@/services/Api'

export default {
    saveSettings(settings) {
        return Api().post('/v1/admin/settings', settings);
    },
    getUserList() {
        return Api().get("/v1/admin/user");
    },
    getUserDetails(id) {
        return Api().get("/v1/admin/user/"+id);
    },
    updateUser(id, username, admin, developer) {
        return Api().put("/v1/admin/user/"+id, {"username": username, "admin": admin, "developer": developer});
    },
    resendValidationMail(id) {
        return Api().post("/v1/admin/mail/"+id+"/resend")
    },
    validateMail(id) {
        return Api().put("/v1/admin/mail/"+id+"/status", {"status": "valide"});
    },
    getAppList() {
        return Api().get("/v1/admin/app");
    },
    saveAppProperties(id, properties) {
        return Api().put("/v1/admin/app/"+id+"/properties", properties);
    },
    listInvites() {
        return Api().get("/v1/admin/invite");
    },
    newInvite(username, comment) {
        return Api().post("/v1/admin/invite", {"username": username, "comment": comment});
    }
}
