|
@@ -37,7 +37,9 @@
|
|
|
<span>
|
|
|
Last Edited {{dBlog.updatedAt | formatDate('LLLL')}}
|
|
|
</span>
|
|
|
- <dropdown :items="draftsOptions" />
|
|
|
+ <dropdown
|
|
|
+ @optionChanged="handleOption($event, dBlog._id)"
|
|
|
+ :items="draftsOptions" />
|
|
|
<!-- Dropdown with menu here -->
|
|
|
</div>
|
|
|
</div>
|
|
@@ -58,7 +60,9 @@
|
|
|
<span>
|
|
|
Last Edited {{pBlog.updatedAt | formatDate('LLLL')}}
|
|
|
</span>
|
|
|
- <dropdown :items="publishedOptions" />
|
|
|
+ <dropdown
|
|
|
+ @optionChanged="handleOption($event, dBlog._id)"
|
|
|
+ :items="publishedOptions" />
|
|
|
<!-- Dropdown with menu here -->
|
|
|
</div>
|
|
|
</div>
|
|
@@ -77,7 +81,9 @@
|
|
|
<script>
|
|
|
import Header from '~/components/shared/Header'
|
|
|
import Dropdown from '~/components/shared/Dropdown'
|
|
|
-import { createPublishedOptions, createDraftsOptions } from '~/pages/instructor/options'
|
|
|
+import { createPublishedOptions,
|
|
|
+ createDraftsOptions,
|
|
|
+ commands } from '~/pages/instructor/options'
|
|
|
import { mapState } from 'vuex';
|
|
|
export default {
|
|
|
layout: 'instructor',
|
|
@@ -99,7 +105,18 @@ export default {
|
|
|
return createDraftsOptions()
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ methods: {
|
|
|
+ handleOption(command, blogId) {
|
|
|
+ // console.log(blogId)
|
|
|
+ debugger
|
|
|
+ if (command === commands.EDIT_BLOG) {
|
|
|
+ this.$router.push(`/instructor/blog/${blogId}/edit`)
|
|
|
+ }
|
|
|
+ if (command === commands.DELETE_BLOG) {
|
|
|
+ alert('Deleting Blog')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
async fetch({store}) {
|
|
|
await store.dispatch('instructor/blog/fetchUserBlogs')
|
|
|
}
|