Skip to content

Commit

Permalink
fix(app): rename api route export name
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Aug 30, 2023
1 parent de2d935 commit 5cbb2ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/app/src/pages/api/[...path].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { APIRoute } from 'astro';
import { WORKER_BASE } from '../../constant';
import { getRuntimeEnv } from '../../utils';

export const all: APIRoute = async ({ request, locals }) => {
export const ALL: APIRoute = async ({ request, locals }) => {
const env = getRuntimeEnv(locals);

const url = new URL(request.url);
Expand Down
4 changes: 3 additions & 1 deletion packages/app/src/pages/feed.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { removeQuote, getRuntimeEnv } from '../utils';

const ManyFilterSchema = z.union([z.array(FilterSchema), FilterSchema.transform((f) => [f])]);

export const get: APIRoute = async (context) => {
export const GET: APIRoute = async (context) => {
try {
const filterString = context.url.searchParams.get('filter');
const rawFilter = filterString ? JSON.parse(filterString) : { page: 1, pageSize: 1000 };
Expand Down Expand Up @@ -60,6 +60,8 @@ export const get: APIRoute = async (context) => {
return new Response(JSON.stringify({ status: 400 }), { status: 400 });
};

export const POST = GET;

function inferTitle(params: URLSearchParams, options: ResolvedFilterOptions) {
if (params.get('title')) {
return params.get('title')!;
Expand Down

0 comments on commit 5cbb2ce

Please sign in to comment.