mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 02:59:45 +00:00
фикс билда
This commit is contained in:
1 parent
968b0b8c82
commit
af763e5865
17 files changed
+224
-134
No files matched your search
@@ -19,8 +19,8 @@ export const fetchMedia = async (): Promise<MediaItem[]> => {
|
||||
while (hasMore) {
|
||||
try {
|
||||
// Запрашиваем медиа с указанной страницы
|
||||
const media = (await wp.media().page(page)) as WPv2.Media[];
|
||||
console.log('media', media);
|
||||
const media = (await wp.media().page(page)) as WPv2.MediaWithPaging;
|
||||
console.log("media", media);
|
||||
|
||||
// Преобразуем данные и добавляем в общий массив
|
||||
const transformedMedia = media.map(({ id, source_url, alt_text }) => {
|
||||
@@ -31,7 +31,6 @@ export const fetchMedia = async (): Promise<MediaItem[]> => {
|
||||
|
||||
allMedia = [...allMedia, ...transformedMedia];
|
||||
|
||||
// Если это последняя страница
|
||||
if (media._paging.totalPages === page) {
|
||||
hasMore = false;
|
||||
break;
|
||||
|
||||
@@ -45,7 +45,7 @@ export const fetchPosts = async (): Promise<App.PostsResult> => {
|
||||
const excerptElement = Parse(post.excerpt.rendered)[0];
|
||||
const newLab: App.LabCard = {
|
||||
...newPost,
|
||||
preview: image?.src || null,
|
||||
preview: image?.src || undefined,
|
||||
previewText: (excerptElement as any)?.props?.children || "",
|
||||
};
|
||||
result.labs[post.id] = newLab;
|
||||
|
||||
Reference in new issue
Block a user