Skip to content

Commit

Permalink
Fix content report POST request
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Bulat <obulat@gmail.com>
  • Loading branch information
obulat committed Jan 20, 2024
1 parent 43ca5ce commit 3620c71
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions frontend/src/components/VContentReport/VContentReportForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
</template>

<script lang="ts">
import { useRuntimeConfig } from "#imports"
import { computed, defineComponent, PropType, ref } from "vue"
import axios from "axios"
Expand Down Expand Up @@ -213,15 +215,18 @@ export default defineComponent({
const mediaType = props.media.frontendMediaType
const reason = selectedReason.value
const {
public: { apiUrl },
} = useRuntimeConfig()
// Not proxied through the Nuxt `/api/` because it is a POST request
await axios.post(
`/api/${mediaSlug(mediaType)}/${props.media.id}/report/`,
`${apiUrl}v1/${mediaSlug(mediaType)}/${props.media.id}/report/`,
{
body: JSON.stringify({
mediaType,
reason,
identifier: props.media.id,
description: description.value,
}),
mediaType,
reason,
identifier: props.media.id,
description: description.value,
}
)
Expand Down

0 comments on commit 3620c71

Please sign in to comment.