Fixed media content fetch
This commit is contained in:
parent
a6d836a543
commit
64d2c12494
@ -68,9 +68,9 @@ export type TextResponse = Root<{
|
||||
}>;
|
||||
|
||||
export type MediaResponse = Root<{
|
||||
_name: string;
|
||||
_foto: Image[];
|
||||
_klyuchNeIzmenya: string;
|
||||
mestopolozheniya: string;
|
||||
foto: Image[];
|
||||
klyuchneizmenyat: string;
|
||||
}>;
|
||||
|
||||
export type Team = Root<{
|
||||
|
||||
@ -91,9 +91,9 @@ export const presentTexts = (texts: TextResponse) =>
|
||||
|
||||
export const presentMedia = (media: MediaResponse) => {
|
||||
return media.records.map((record) => ({
|
||||
key: record._klyuchNeIzmenya,
|
||||
name: record._name,
|
||||
photo: presentImage(record._foto),
|
||||
key: record.klyuchneizmenyat,
|
||||
name: record.mestopolozheniya,
|
||||
photo: presentImage(record.foto),
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
@ -124,14 +124,14 @@ export const textsRequest = {
|
||||
};
|
||||
|
||||
export const mediaRequest = {
|
||||
_mediaKontentS: {
|
||||
mediakontentsajta: {
|
||||
records: {
|
||||
_name: true,
|
||||
_foto: {
|
||||
mestopolozheniya: true,
|
||||
foto: {
|
||||
id: true,
|
||||
url: true,
|
||||
},
|
||||
_klyuchNeIzmenya: true,
|
||||
klyuchneizmenyat: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -17,7 +17,7 @@ export const mediaControlApi = taylorAPI.injectEndpoints({
|
||||
},
|
||||
}),
|
||||
transformResponse: (response: any) => {
|
||||
return presentMedia(response.data._mediaKontentS);
|
||||
return presentMedia(response.data.mediakontentsajta);
|
||||
},
|
||||
}),
|
||||
}),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user