feat: add public seller directory
This commit is contained in:
@@ -11,6 +11,7 @@ import { registerPublicListingRoutes } from '../modules/listings/routes/public-l
|
||||
import { registerAdminProductRoutes } from '../modules/products/routes/admin-product-routes.js';
|
||||
import { registerPublicProductRoutes } from '../modules/products/routes/public-product-routes.js';
|
||||
import { registerPublicSearchRoutes } from '../modules/search/routes/public-search-routes.js';
|
||||
import { registerPublicSellerRoutes } from '../modules/sellers/routes/public-seller-routes.js';
|
||||
|
||||
export function buildApp(dependencies) {
|
||||
const app = Fastify();
|
||||
@@ -70,6 +71,10 @@ export function buildApp(dependencies) {
|
||||
...dependencies,
|
||||
prefix: '/api/v1',
|
||||
});
|
||||
app.register(registerPublicSellerRoutes, {
|
||||
...dependencies,
|
||||
prefix: '/api/v1',
|
||||
});
|
||||
|
||||
return app;
|
||||
}
|
||||
@@ -28,6 +28,8 @@ import { createProductRepository } from '../modules/products/repositories/produc
|
||||
import { createProductService } from '../modules/products/services/product-service.js';
|
||||
import { createPublicProductService } from '../modules/products/services/public-product-service.js';
|
||||
import { createSearchService } from '../modules/search/services/search-service.js';
|
||||
import { createSellerRepository } from '../modules/sellers/repositories/seller-repository.js';
|
||||
import { createPublicSellerService } from '../modules/sellers/services/public-seller-service.js';
|
||||
|
||||
function parsePort(value) {
|
||||
const port = Number.parseInt(value ?? '3000', 10);
|
||||
@@ -46,6 +48,7 @@ async function startServer() {
|
||||
const inventoryItemRepository = createInventoryItemRepository(database.db);
|
||||
const inventoryImageRepository = createInventoryImageRepository(database.db);
|
||||
const listingRepository = createListingRepository(database.db);
|
||||
const sellerRepository = createSellerRepository(database.db);
|
||||
const conditionRepository = createConditionRepository(database.db);
|
||||
const userRepository = createUserRepository(database.db);
|
||||
const sessionRepository = createSessionRepository(database.db);
|
||||
@@ -93,6 +96,7 @@ async function startServer() {
|
||||
productService: createProductService({ productRepository }),
|
||||
publicProductService: createPublicProductService({ productRepository }),
|
||||
searchService: createSearchService({ listingRepository }),
|
||||
publicSellerService: createPublicSellerService({ sellerRepository }),
|
||||
});
|
||||
|
||||
app.addHook('onClose', async () => {
|
||||
|
||||
Reference in New Issue
Block a user