Compare commits

..

No commits in common. "master" and "develop" have entirely different histories.

2 changed files with 3 additions and 23 deletions

8
src/app.d.ts vendored
View File

@ -1,15 +1,13 @@
// 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 {}
// interface Platform {} // interface Platform {}

View File

@ -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();
};