Compare commits

..

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

2 changed files with 3 additions and 23 deletions

6
src/app.d.ts vendored
View File

@ -1,14 +1,12 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
import { Pool } from "pg";
import type { SimpleGit } from "simple-git";
import { Database } from 'pg';
declare global {
namespace App {
// interface Error {}
interface Locals {
db: Pool;
git: SimpleGit;
db: any;
}
// interface PageData {}
// interface PageState {}

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