mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-04 05:10:11 +00:00
Fix import to limit to 100, and scope to me for personal lists
This commit is contained in:
@@ -45,18 +45,20 @@ export async function fetchHardcoverList(
|
|||||||
const statusId = parseInt(listIdStr.replace('status-', ''), 10);
|
const statusId = parseInt(listIdStr.replace('status-', ''), 10);
|
||||||
const query = `
|
const query = `
|
||||||
query GetStatusBooks($statusId: Int!) {
|
query GetStatusBooks($statusId: Int!) {
|
||||||
user_books(where: {status_id: {_eq: $statusId}}) {
|
me {
|
||||||
book {
|
user_books(where: {status_id: {_eq: $statusId}}, limit: 100, order_by: {id: desc}) {
|
||||||
id
|
book {
|
||||||
title
|
id
|
||||||
contributions {
|
title
|
||||||
author {
|
contributions {
|
||||||
name
|
author {
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cached_image
|
||||||
|
image {
|
||||||
|
url
|
||||||
}
|
}
|
||||||
}
|
|
||||||
cached_image
|
|
||||||
image {
|
|
||||||
url
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,7 +83,7 @@ export async function fetchHardcoverList(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const userBooks = response.data?.data?.user_books || [];
|
const userBooks = response.data?.data?.me?.[0]?.user_books || [];
|
||||||
let listName = 'Hardcover Status List';
|
let listName = 'Hardcover Status List';
|
||||||
|
|
||||||
// Map status numbers to names
|
// Map status numbers to names
|
||||||
@@ -143,7 +145,7 @@ export async function fetchHardcoverList(
|
|||||||
|
|
||||||
const query = `
|
const query = `
|
||||||
query GetListBooks($listId: Int!) {
|
query GetListBooks($listId: Int!) {
|
||||||
list_books(where: {list_id: {_eq: $listId}}) {
|
list_books(where: {list_id: {_eq: $listId}}, limit: 100, order_by: {id: desc}) {
|
||||||
list { name }
|
list { name }
|
||||||
book {
|
book {
|
||||||
id title cached_image image { url }
|
id title cached_image image { url }
|
||||||
@@ -155,7 +157,7 @@ export async function fetchHardcoverList(
|
|||||||
|
|
||||||
const queryUuid = `
|
const queryUuid = `
|
||||||
query GetListBooksUuid($listId: uuid!) {
|
query GetListBooksUuid($listId: uuid!) {
|
||||||
list_books(where: {list_id: {_eq: $listId}}) {
|
list_books(where: {list_id: {_eq: $listId}}, limit: 100, order_by: {id: desc}) {
|
||||||
list { name }
|
list { name }
|
||||||
book {
|
book {
|
||||||
id title cached_image image { url }
|
id title cached_image image { url }
|
||||||
@@ -169,7 +171,7 @@ export async function fetchHardcoverList(
|
|||||||
query GetListBooksBySlug($slug: String!) {
|
query GetListBooksBySlug($slug: String!) {
|
||||||
lists(where: {slug: {_eq: $slug}}, limit: 1) {
|
lists(where: {slug: {_eq: $slug}}, limit: 1) {
|
||||||
name
|
name
|
||||||
list_books {
|
list_books(limit: 100, order_by: {id: desc}) {
|
||||||
book {
|
book {
|
||||||
id title cached_image image { url }
|
id title cached_image image { url }
|
||||||
contributions { author { name } }
|
contributions { author { name } }
|
||||||
|
|||||||
Reference in New Issue
Block a user