Skip to content

Commit

Permalink
db / wiki bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
armintalaie committed Mar 14, 2024
1 parent fcd909f commit 18f5b51
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 52 deletions.
96 changes: 46 additions & 50 deletions lib/wiki.stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ApiService, IApiResources } from './templates/apigateway';
import { Role, ServicePrincipal, PolicyStatement } from 'aws-cdk-lib/aws-iam';
config();

export const WIKI_STACK_INFO: StackInfo = { NAME: 'wiki-stack' };
export const WIKI_STACK_INFO: StackInfo = { NAME: 'hub-wiki-stack' };

export class WikiStack extends LPStack {
public STACK_INFO: StackInfo = WIKI_STACK_INFO;
Expand Down Expand Up @@ -50,65 +50,61 @@ export class WikiStack extends LPStack {

const apiResources: IApiResources = {
subresources: {
docs: {
areas: {
endpoints: {
GET: {
id: 'getAreas',
path: `${baseLambdaDir}/getAreas`,
},
POST: {
id: 'createArea',
path: `${baseLambdaDir}/createArea`,
},
},
subresources: {
area: {
'{areaid}': {
endpoints: {
GET: {
id: 'getAreas',
path: `${baseLambdaDir}/getAreas`,
id: 'getArea',
path: `${baseLambdaDir}/getArea`,
},
POST: {
id: 'createArea',
path: `${baseLambdaDir}/createArea`,
DELETE: {
id: 'deleteArea',
path: `${baseLambdaDir}/deleteArea`,
},
PATCH: {
id: 'updateArea',
path: `${baseLambdaDir}/updateArea`,
},
},
subresources: {
'{areaid}': {
endpoints: {
GET: {
id: 'getArea',
path: `${baseLambdaDir}/getArea`,
},
DELETE: {
id: 'deleteArea',
path: `${baseLambdaDir}/deleteArea`,
},
PATCH: {
id: 'updateArea',
path: `${baseLambdaDir}/updateArea`,
},
},
doc: {
subresources: {
doc: {
subresources: {
'{docid}': {
endpoints: {
DELETE: {
id: 'deleteDoc',
path: `${baseLambdaDir}/deletedoc`,
},
GET: {
id: 'getDoc',
path: `${baseLambdaDir}/getdoc`,
},
PUT: {
id: 'putDoc',
path: `${baseLambdaDir}/putdoc`,
},
},
// subresources: {
// 'content': {
// endpoints: {
// GET: {
// id: 'getContent',
// path: `${baseLambdaDir}/getContent`,
// },
// },
// },
// },
'{docid}': {
endpoints: {
DELETE: {
id: 'deleteDoc',
path: `${baseLambdaDir}/deletedoc`,
},
GET: {
id: 'getDoc',
path: `${baseLambdaDir}/getdoc`,
},
PUT: {
id: 'putDoc',
path: `${baseLambdaDir}/putdoc`,
},
},
// subresources: {
// 'content': {
// endpoints: {
// GET: {
// id: 'getContent',
// path: `${baseLambdaDir}/getContent`,
// },
// },
// },
// },
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/util/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export function getDatabase() {
const db = new Kysely<Database>({
dialect: new PlanetScaleDialect({
host: process.env.DATABASE_HOST,
username: process.env.DATABASE_HOST,
password: process.env.DATABASE_HOST,
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
}),
});

Expand Down

0 comments on commit 18f5b51

Please sign in to comment.