Compare commits
No commits in common. "master" and "develop" have entirely different histories.
6
src/app.d.ts
vendored
6
src/app.d.ts
vendored
|
@ -1,14 +1,12 @@
|
||||||
// See https://kit.svelte.dev/docs/types#app
|
// See https://kit.svelte.dev/docs/types#app
|
||||||
// for information about these interfaces
|
// for information about these interfaces
|
||||||
import { Pool } from "pg";
|
import { Database } from 'pg';
|
||||||
import type { SimpleGit } from "simple-git";
|
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
namespace App {
|
namespace App {
|
||||||
// interface Error {}
|
// interface Error {}
|
||||||
interface Locals {
|
interface Locals {
|
||||||
db: Pool;
|
db: any;
|
||||||
git: SimpleGit;
|
|
||||||
}
|
}
|
||||||
// interface PageData {}
|
// interface PageData {}
|
||||||
// interface PageState {}
|
// interface PageState {}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
import { json } from '@sveltejs/kit';
|
|
||||||
import { error } from '@sveltejs/kit';
|
|
||||||
import type { RequestHandler } from './$types';
|
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ url, locals }) => {
|
|
||||||
const category = String(url.searchParams.get('category'));
|
|
||||||
|
|
||||||
if (!category) {
|
|
||||||
error(400, 'Bad request');
|
|
||||||
}
|
|
||||||
|
|
||||||
const db = await locals.db;
|
|
||||||
const article = await db.query(
|
|
||||||
'SELECT * FROM article WHERE category = $1',
|
|
||||||
[category]
|
|
||||||
);
|
|
||||||
return new Response();
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user