mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
adds deleteProfilRequest to the new ProfilUpdate FhcAPIController
This commit is contained in:
@@ -46,8 +46,8 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
'selectProfilRequest' => self::PERM_LOGGED,
|
||||
'insertProfilRequest' => self::PERM_LOGGED,
|
||||
'updateProfilRequest' => self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
'deleteProfilRequest' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases(
|
||||
@@ -238,6 +238,17 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(success($updateID));
|
||||
}
|
||||
|
||||
public function deleteProfilRequest()
|
||||
{
|
||||
|
||||
$requestID = $this->input->post('requestID', true);
|
||||
$result = $this->ProfilUpdateModel->delete([$requestID]);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getProfilRequestFiles($id)
|
||||
{
|
||||
if(!$id){
|
||||
|
||||
@@ -100,14 +100,15 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
//TODO post request
|
||||
deleteProfilRequest: function (requestID) {
|
||||
const url =
|
||||
|
||||
return this.$fhcApi.post(
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/deleteProfilRequest`;
|
||||
|
||||
return axios.post(url, requestID);
|
||||
`/api/frontend/v1/ProfilUpdate/deleteProfilRequest`,
|
||||
{
|
||||
requestID,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -107,17 +107,18 @@ export default {
|
||||
},
|
||||
|
||||
deleteRequest: function (item) {
|
||||
Vue.$fhcapi.ProfilUpdate.deleteProfilRequest(item.profil_update_id).then(
|
||||
this.$fhcApi.factory.profilUpdate.deleteProfilRequest(item.profil_update_id).then(
|
||||
(res) => {
|
||||
if (res.data.error) {
|
||||
//? open alert
|
||||
console.log(res.data);
|
||||
console.error("error happened",res.data);
|
||||
} else {
|
||||
this.$emit("fetchUpdates");
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
getView: function (topic, status) {
|
||||
if (!(status === this.profilUpdateStates["Pending"])) {
|
||||
return "Status";
|
||||
|
||||
Reference in New Issue
Block a user