admin front: entite active boolean
This commit is contained in:
@@ -38,17 +38,24 @@ export default {
|
||||
},
|
||||
save(checked){
|
||||
// console.log('save csrf_token', this.csrf_token);
|
||||
const params = {
|
||||
let params = {
|
||||
type: this.data.bundle,
|
||||
nid: [{"value":this.data.nid}],
|
||||
// nid: [{"value":this.data.nid}],
|
||||
[this.data.field]: {value: checked}
|
||||
};
|
||||
if (this.data.entitytype === 'node') {
|
||||
params.nid = [{"value":this.data.id}];
|
||||
} else {
|
||||
params.id = [{"value":this.data.id}];
|
||||
}
|
||||
const configs = {
|
||||
headers: {'X-CSRF-Token': this.csrf_token}
|
||||
};
|
||||
REST.patch(`/node/${this.data.nid}?_format=json`, params, configs)
|
||||
|
||||
let url_base = `/${this.data.entitytype === 'node' ? '' : 'entity/'}${this.data.entitytype}`;
|
||||
REST.patch(`${url_base}/${this.data.id}?_format=json`, params, configs)
|
||||
.then(({ data }) => {
|
||||
console.log('user REST post node data', data)
|
||||
console.log(`checkboxEditable REST patch ${this.data.entitytype} data`, data)
|
||||
// TODO if success update the data in pinia
|
||||
// this.reloadConcernements();
|
||||
this.$emit('updated');
|
||||
|
Reference in New Issue
Block a user