Новые правки сайта
This commit is contained in:
parent
3411dd4931
commit
9bee21ad45
2 changed files with 4 additions and 4 deletions
|
|
@ -12,14 +12,14 @@ interface ReviewRecord {
|
||||||
created: string;
|
created: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const POCKETBASE_URL = import.meta.env.POCKETBASE_URL || 'http://127.0.0.1:8090';
|
const PB_POCKETBASE_URL = import.meta.env.PB_POCKETBASE_URL || import.meta.env.POCKETBASE_URL || 'http://127.0.0.1:8090';
|
||||||
|
|
||||||
let reviews: ReviewRecord[] = [];
|
let reviews: ReviewRecord[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const filter = 'status = "published"';
|
const filter = 'status = "published"';
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${POCKETBASE_URL}/api/collections/reviews/records?filter=${encodeURIComponent(filter)}&sort=-created&perPage=10`
|
`${PB_POCKETBASE_URL}/api/collections/reviews/records?filter=${encodeURIComponent(filter)}&sort=-created&perPage=10`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ interface ReviewRecord {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const POCKETBASE_URL = import.meta.env.POCKETBASE_URL || 'http://127.0.0.1:8090';
|
const PB_POCKETBASE_URL = import.meta.env.PB_POCKETBASE_URL || import.meta.env.POCKETBASE_URL || 'http://127.0.0.1:8090';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
status?: string;
|
status?: string;
|
||||||
|
|
@ -45,7 +45,7 @@ try {
|
||||||
const sort = '-created';
|
const sort = '-created';
|
||||||
|
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${POCKETBASE_URL}/api/collections/reviews/records?expand=${expand}&filter=${encodeURIComponent(filter)}&sort=${sort}`
|
`${PB_POCKETBASE_URL}/api/collections/reviews/records?expand=${expand}&filter=${encodeURIComponent(filter)}&sort=${sort}`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue