Add categories to newpost

This commit is contained in:
Peter Stuifzand 2020-08-18 23:05:12 +02:00
parent 00b641998a
commit 16ea750006

View File

@ -12,9 +12,14 @@
</div> </div>
</div> </div>
<div class="field"> <div class="field">
Categories: <entry-categories v-model="categories" />
</div>
<div class="field">
Syndication:
<syndication-buttons v-model="selectedTargets" :targets="targets"/> <syndication-buttons v-model="selectedTargets" :targets="targets"/>
</div> </div>
<div class="field"> <div class="field">
Destinations:
<destination-buttons v-model="selectedDestinations" :targets="destinations"/> <destination-buttons v-model="selectedDestinations" :targets="destinations"/>
</div> </div>
<div class="level"> <div class="level">
@ -39,13 +44,16 @@
</template> </template>
<script> <script>
import SyndicationButtons from "@/components/SyndicationButtons";
import DestinationButtons from "@/components/DestinationButtons"; import DestinationButtons from "@/components/DestinationButtons";
import EntryCategories from "@/components/EntryCategories";
import SyndicationButtons from "@/components/SyndicationButtons";
export default { export default {
name: "NewPost", name: "NewPost",
components:{ components:{
SyndicationButtons,
DestinationButtons, DestinationButtons,
EntryCategories,
SyndicationButtons,
}, },
data() { data() {
return { return {
@ -53,7 +61,8 @@
targets: [], targets: [],
selectedTargets: [], selectedTargets: [],
destinations: [], destinations: [],
selectedDestinations: [] selectedDestinations: [],
categories: []
} }
}, },
mounted() { mounted() {
@ -68,11 +77,15 @@
'type': ['h-entry'], 'type': ['h-entry'],
'properties': { 'properties': {
'content': [this.newPost], 'content': [this.newPost],
'category': this.categories,
'mp-syndicate-to': this.selectedTargets, 'mp-syndicate-to': this.selectedTargets,
'mp-destination': this.selectedDestinations, 'mp-destination': this.selectedDestinations,
}, },
}).then(() => { }).then(() => {
this.newPost = ''; this.newPost = ''
this.categories = []
this.selectedTargets = []
this.selectedDestinations = []
this.$emit('close') this.$emit('close')
}) })
}, },