Skip to content

Commit

Permalink
Ensure correct API usage for frontend related media requests (#4891)
Browse files Browse the repository at this point in the history
* Ensure correct API usage for frontend related reqs

* Remove unnecessary API nginx log props
  • Loading branch information
sarayourfriend authored Sep 9, 2024
1 parent de091ba commit 8904622
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions api/nginx/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ log_format json_combined escape=json
'"http_user_agent":"$http_user_agent",'
'"http_x_forwarded_for":"$http_x_forwarded_for",'
'"http_authorization":"$http_authorization",'
'"request_id":"$sent_http_x_request_id",'
'"client_application_name":"$sent_http_x_ov_client_application_name",'
'"client_application_verified":"$sent_http_x_ov_client_application_verified"'
'"request_id":"$sent_http_x_request_id"'
'}';

access_log /var/log/nginx/access.log json_combined;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/stores/media/related-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { defineStore } from "pinia"
import type { FetchingError, FetchState } from "~/types/fetch-state"
import type { Media } from "~/types/media"
import type { SupportedMediaType } from "~/constants/media"
import { createApiClient } from "~/data/api-service"
import { useApiClient } from "~/composables/use-api-client"

interface RelatedMediaState {
mainMediaId: null | string
Expand Down Expand Up @@ -52,7 +52,7 @@ export const useRelatedMediaStore = defineStore("related-media", {
this.mainMediaId = id
this._startFetching()
this.media = []
const client = createApiClient()
const client = useApiClient()

try {
this.media = await client.getRelatedMedia(mediaType, id)
Expand Down

0 comments on commit 8904622

Please sign in to comment.