Skip to content

Commit

Permalink
#fix: thuanvv fix v2
Browse files Browse the repository at this point in the history
  • Loading branch information
VanThuan76 committed Jan 8, 2025
1 parent 439ea50 commit 755d903
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 41 deletions.
34 changes: 34 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"fastify": "^4.26.1",
"fastify-plugin": "^4.5.1",
"helmet": "^7.1.0",
"json-schema-to-ts": "^3.1.1",
"pino": "^8.18.0",
"zod": "^3.22.4"
},
Expand Down
1 change: 0 additions & 1 deletion src/application/common/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './config';
export * from './logger';
export * from './posts-repository';
export * from './pages-repository';
export * from './sections-repository';
export * from './components-repository';
Expand Down
8 changes: 0 additions & 8 deletions src/application/common/interfaces/posts-repository.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/domain/entities/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './post';
export * from './page';
export * from './section';
export * from './component';
Expand Down
1 change: 0 additions & 1 deletion src/infrastructure/repositories/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './posts-repository';
export * from './pages-repository';
export * from './sections-repository';
export * from './components-repository';
Expand Down
59 changes: 29 additions & 30 deletions tests/api/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Post } from '@domain/entities';
import { Dependencies } from '@infrastructure/di';
import app from '@web/app';
import { randomUUID } from 'crypto';
Expand All @@ -21,33 +20,33 @@ export async function makeClient() {
}

async function seedDatabase({ db }: Dependencies) {
const posts: Post[] = [
{
id: randomUUID(),
createdAt: new Date('2024-01-01T00:00:00Z'),
title: 'First post',
},
{
id: randomUUID(),
createdAt: new Date('2024-01-02T04:24:00Z'),
title: 'Second post',
},
{
id: randomUUID(),
createdAt: new Date('2024-01-03T00:00:00Z'),
title: 'Third post',
},
];

await db.post.createMany({
data: posts.map((post) => ({
id: post.id,
createdAt: post.createdAt,
title: post.title,
})),
});

return {
posts,
};
// const posts: Post[] = [
// {
// id: randomUUID(),
// createdAt: new Date('2024-01-01T00:00:00Z'),
// title: 'First post',
// },
// {
// id: randomUUID(),
// createdAt: new Date('2024-01-02T04:24:00Z'),
// title: 'Second post',
// },
// {
// id: randomUUID(),
// createdAt: new Date('2024-01-03T00:00:00Z'),
// title: 'Third post',
// },
// ];

// await db.post.createMany({
// data: posts.map((post) => ({
// id: post.id,
// createdAt: post.createdAt,
// title: post.title,
// })),
// });

// return {
// posts,
// };
}

0 comments on commit 755d903

Please sign in to comment.