Add option to append line to planner

This commit is contained in:
D. Berge
2020-10-08 16:39:04 +02:00
parent a8fa238e68
commit c4915e43d7

View File

@@ -28,6 +28,9 @@
<v-list-item-title v-if="contextMenuItem.ntba">Unset NTBA</v-list-item-title>
<v-list-item-title v-else>Set NTBA</v-list-item-title>
</v-list-item>
<v-list-item @click="addToPlan" v-if="!contextMenuItem.ntba">
<v-list-item-title>Add to plan</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
@@ -244,7 +247,24 @@ export default {
value: !this.contextMenuItem.ntba
})
},
async addToPlan () {
const payload = {
sequence: null,
line: this.contextMenuItem.line,
fsp: this.contextMenuItem.fsp,
lsp: this.contextMenuItem.lsp
}
console.log("Plan", payload);
const url = `/project/${this.$route.params.project}/plan`;
const init = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: payload
}
await this.api([url, init]);
},
editItem (item, key) {
this.edit = {
line: item.line,