fix(front): [regression] re-enable publish action for channel uploads
This commit is contained in:
parent
465010d3ea
commit
0d743b7ca2
|
@ -404,6 +404,7 @@ const labels = computed(() => ({
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const publish = async () => {
|
const publish = async () => {
|
||||||
|
console.log("TRYING TO PUBLISH")
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
|
|
||||||
errors.value = []
|
errors.value = []
|
||||||
|
@ -414,17 +415,10 @@ const publish = async () => {
|
||||||
/* { import_status: components["schemas"]["ImportStatusEnum"];
|
/* { import_status: components["schemas"]["ImportStatusEnum"];
|
||||||
audio_file: string;} */
|
audio_file: string;} */
|
||||||
|
|
||||||
// const theUpdate : components['schemas']['PatchedUploadForOwnerRequest'] = {
|
await axios.post<paths['/api/v2/uploads/action/']['post']['responses']['200']['content']['application/json']>('uploads/action/', {
|
||||||
// import_status: 'pending',
|
action: 'publish',
|
||||||
// }
|
objects: uploadedFiles.value.map((file) => file.response?.uuid)
|
||||||
|
})
|
||||||
// await axios.post('uploads/action/', {
|
|
||||||
// action: 'publish',
|
|
||||||
// objects: uploadedFiles.value.map((file) => file.response?.uuid)
|
|
||||||
// } satisfies paths['/api/v2/uploads/action/']['post']['requestBody']['content']['application/json'],
|
|
||||||
// {
|
|
||||||
// headers: { 'Authorization': `Bearer ${store.state.auth.oauth}` }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// Tell the store that the uploaded files are pending import
|
// Tell the store that the uploaded files are pending import
|
||||||
store.commit('channels/publish', {
|
store.commit('channels/publish', {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
import onKeyboardShortcut from '~/composables/onKeyboardShortcut'
|
import onKeyboardShortcut from '~/composables/onKeyboardShortcut'
|
||||||
|
@ -13,6 +13,8 @@ import Alert from '~/components/ui/Alert.vue'
|
||||||
import Card from '~/components/ui/Card.vue'
|
import Card from '~/components/ui/Card.vue'
|
||||||
|
|
||||||
import type { Actor, Channel, PrivacyLevel } from '~/types'
|
import type { Actor, Channel, PrivacyLevel } from '~/types'
|
||||||
|
import type { paths } from '~/generated/types'
|
||||||
|
import axios from 'axios'
|
||||||
import FileUploadWidget from '~/components/library/FileUploadWidget.vue'
|
import FileUploadWidget from '~/components/library/FileUploadWidget.vue'
|
||||||
import type { VueUploadItem } from 'vue-upload-component'
|
import type { VueUploadItem } from 'vue-upload-component'
|
||||||
import ChannelUpload from '~/components/channels/UploadForm.vue'
|
import ChannelUpload from '~/components/channels/UploadForm.vue'
|
||||||
|
@ -144,7 +146,7 @@ const channelUpload = ref()
|
||||||
v-if="state.uploadDestination?.type === 'channel'"
|
v-if="state.uploadDestination?.type === 'channel'"
|
||||||
ref="channelUpload"
|
ref="channelUpload"
|
||||||
:filter="state.uploadDestination.filter"
|
:filter="state.uploadDestination.filter"
|
||||||
:channel="null"
|
:channel="state.uploadDestination?.channel || null"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
@ -179,7 +181,7 @@ const channelUpload = ref()
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
v-if="channelUpload"
|
v-if="channelUpload"
|
||||||
:on-click="() => channelUpload.publish()"
|
@click="() => { channelUpload.publish(); isOpen = false }"
|
||||||
>
|
>
|
||||||
<!-- Set update import_metadata from 'draft' to 'public' -->
|
<!-- Set update import_metadata from 'draft' to 'public' -->
|
||||||
{{ t('components.channels.UploadModal.button.publish') }}
|
{{ t('components.channels.UploadModal.button.publish') }}
|
||||||
|
|
|
@ -124,20 +124,22 @@ const albumModal = ref()
|
||||||
<h3 class="ui header">
|
<h3 class="ui header">
|
||||||
{{ t('views.channels.DetailOverview.header.uploadsFailure') }}
|
{{ t('views.channels.DetailOverview.header.uploadsFailure') }}
|
||||||
</h3>
|
</h3>
|
||||||
<Button
|
<Link
|
||||||
v-if="skippedUploads.length > 0"
|
v-if="skippedUploads.length > 0"
|
||||||
secondary
|
secondary
|
||||||
|
solid
|
||||||
:to="{name: 'content.libraries.files', query: {q: 'status:skipped'}}"
|
:to="{name: 'content.libraries.files', query: {q: 'status:skipped'}}"
|
||||||
>
|
>
|
||||||
{{ t('views.channels.DetailOverview.link.skippedUploads') }}
|
{{ t('views.channels.DetailOverview.link.skippedUploads') }}
|
||||||
</Button>
|
</Link>
|
||||||
<Button
|
<Link
|
||||||
v-if="erroredUploads.length > 0"
|
v-if="erroredUploads.length > 0"
|
||||||
secondary
|
secondary
|
||||||
|
solid
|
||||||
:to="{name: 'content.libraries.files', query: {q: 'status:errored'}}"
|
:to="{name: 'content.libraries.files', query: {q: 'status:errored'}}"
|
||||||
>
|
>
|
||||||
{{ t('views.channels.DetailOverview.link.erroredUploads') }}
|
{{ t('views.channels.DetailOverview.link.erroredUploads') }}
|
||||||
</Button>
|
</Link>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<Loader />
|
<Loader />
|
||||||
|
|
Loading…
Reference in New Issue