Merge pull request #9 from Salastil/claude/source-management-content-1w2yno
Fix Local category page never showing Local-tagged sources
This commit is contained in:
@@ -3,10 +3,12 @@ import { getFeed } from '$lib/api';
|
|||||||
|
|
||||||
const PAGE_SIZE = 15;
|
const PAGE_SIZE = 15;
|
||||||
|
|
||||||
|
// Every category page (including "Local") filters by its category name — sources are
|
||||||
|
// assigned categories directly via checkboxes in the admin Sources tab, so a source
|
||||||
|
// tagged "Local" shows up here the same way one tagged "Tech" shows up on /category/tech.
|
||||||
export const load: PageLoad = async ({ params, fetch }) => {
|
export const load: PageLoad = async ({ params, fetch }) => {
|
||||||
const name = params.name;
|
const name = params.name;
|
||||||
const isLocal = name.toLowerCase() === 'local';
|
const filters = { category: name };
|
||||||
const filters = isLocal ? { geo: 'philadelphia' } : { category: name };
|
|
||||||
const initial = await getFeed({ ...filters, limit: PAGE_SIZE }, fetch);
|
const initial = await getFeed({ ...filters, limit: PAGE_SIZE }, fetch);
|
||||||
return { initial, filters, name, pageSize: PAGE_SIZE };
|
return { initial, filters, name, pageSize: PAGE_SIZE };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user