Skip to content

Commit

Permalink
pg fix
Browse files Browse the repository at this point in the history
  • Loading branch information
armintalaie committed Apr 9, 2024
1 parent 4a81309 commit 1ada6a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/wiki/area/getArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { APIGatewayProxyEvent } from 'aws-lambda';
import { APIResponse, SuccessResponse } from '../../util/middleware/response';
import { Authorizer } from '../../util/middleware/authorizer';
import { InputValidator } from '../../util/middleware/inputValidator';
import { jsonArrayFrom } from 'kysely/helpers/mysql';
import { Database, getDatabase } from '../../util/db';
import { jsonArrayFrom } from 'kysely/helpers/postgres'

const db = getDatabase();

export const handler = new LambdaBuilder(router)
Expand Down
5 changes: 1 addition & 4 deletions src/wiki/area/getAreas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { InputValidator } from '../../util/middleware/inputValidator';
import { getDatabase } from '../../util/db';
import { IAreaQuery } from '../../util/types/general';
import { LambdaBuilder, LambdaInput } from '../../util/middleware/middleware';
Expand All @@ -18,7 +17,7 @@ const db = getDatabase();
const LIMIT = 50;
const OFFSET = 0;
export const handler = new LambdaBuilder(getRequest)
.use(new InputValidator())
// .use(new InputValidator())
.use(new Authorizer(db))
.use(new PaginationHelper({ limit: LIMIT, offset: OFFSET }))
.useAfter(new ResponseMetaTagger())
Expand All @@ -41,8 +40,6 @@ export async function getAll(areaQuery: IAreaQuery) {
const res = await db
.selectFrom('area')
.selectAll()
// .limit(areaQuery.limit || 10)
// .offset(areaQuery.offset || 0)
.execute();
return res;
}

0 comments on commit 1ada6a7

Please sign in to comment.