diff --git a/src/api/index.ts b/src/api/index.ts index a3b929b..b3b54ab 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -4,15 +4,15 @@ import { } from "medusa-core-utils"; import { ConfigModule } from "@medusajs/medusa"; import cors from 'cors' -import { deleteCustomer } from "./routes/delete-customer"; -import { listDeletedCustomers } from "./routes/list-deleted"; -import { restoreCustomer } from "./routes/restore-customer"; +import { deleteCustomer } from "./routes/admin/delete-customer"; +import { listDeletedCustomers } from "./routes/admin/list-deleted"; +import { restoreCustomer } from "./routes/admin/restore-customer"; import { uploadFile } from "./routes/global/uploads"; import { S3Client } from "@aws-sdk/client-s3"; -import { SheetsRouter } from "./routes/sheets"; -import { SheetsSyncCategoriesRouter } from "./routes/sheets/sync-categories"; -import { SheetsSyncLocationsRouter } from "./routes/sheets/sync-locations"; -import { SheetsSyncProductsRouter } from "./routes/sheets/sync-products"; +import { SheetsRouter } from "./routes/admin/sheets"; +import { SheetsSyncCategoriesRouter } from "./routes/admin/sheets/sync-categories"; +import { SheetsSyncLocationsRouter } from "./routes/admin/sheets/sync-locations"; +import { SheetsSyncProductsRouter } from "./routes/admin/sheets/sync-products"; export default (rootDirectory: string): Router | Router[] => { const { configModule: { projectConfig } } = getConfigFile(rootDirectory, "medusa-config") diff --git a/src/api/routes/delete-customer.ts b/src/api/routes/admin/delete-customer.ts similarity index 100% rename from src/api/routes/delete-customer.ts rename to src/api/routes/admin/delete-customer.ts diff --git a/src/api/routes/list-deleted.ts b/src/api/routes/admin/list-deleted.ts similarity index 91% rename from src/api/routes/list-deleted.ts rename to src/api/routes/admin/list-deleted.ts index 392fe5a..0ad873e 100644 --- a/src/api/routes/list-deleted.ts +++ b/src/api/routes/admin/list-deleted.ts @@ -1,6 +1,6 @@ import { authenticate } from "@medusajs/medusa" import { Router } from "express"; -import CustomerService from "../../services/customer"; +import CustomerService from "../../../services/customer"; export const listDeletedCustomers = (router: Router) => { router.use('/admin/customers/list-deleted', authenticate()); diff --git a/src/api/routes/restore-customer.ts b/src/api/routes/admin/restore-customer.ts similarity index 93% rename from src/api/routes/restore-customer.ts rename to src/api/routes/admin/restore-customer.ts index 09da7e8..bf7cb89 100644 --- a/src/api/routes/restore-customer.ts +++ b/src/api/routes/admin/restore-customer.ts @@ -1,6 +1,6 @@ import { authenticate } from "@medusajs/medusa" import express, { Router } from "express"; -import CustomerService from "../../services/customer"; +import CustomerService from "../../../services/customer"; export const restoreCustomer = (router: Router) => { router.use('/admin/customers/restore', express.json(), authenticate()); diff --git a/src/api/routes/sheets/helpers/mapSheetProduct.ts b/src/api/routes/admin/sheets/helpers/mapSheetProduct.ts similarity index 100% rename from src/api/routes/sheets/helpers/mapSheetProduct.ts rename to src/api/routes/admin/sheets/helpers/mapSheetProduct.ts diff --git a/src/api/routes/sheets/index.ts b/src/api/routes/admin/sheets/index.ts similarity index 93% rename from src/api/routes/sheets/index.ts rename to src/api/routes/admin/sheets/index.ts index 75bb790..50f4d03 100644 --- a/src/api/routes/sheets/index.ts +++ b/src/api/routes/admin/sheets/index.ts @@ -1,8 +1,8 @@ import { ProductOption, ProductStatus, authenticate } from "@medusajs/medusa" import express, { Router } from "express"; -import CategoryService from "../../../services/category"; -import GoogleSheetAPIService, { ProductData } from "../../../services/google-sheet-api"; -import ProductService from "../../../services/product"; +import CategoryService from "../../../../services/category"; +import GoogleSheetAPIService, { ProductData } from "../../../../services/google-sheet-api"; +import ProductService from "../../../../services/product"; import { mapSheetProduct } from "./helpers/mapSheetProduct"; type CategoriesID = { id: string }[]; diff --git a/src/api/routes/sheets/sync-categories.ts b/src/api/routes/admin/sheets/sync-categories.ts similarity index 88% rename from src/api/routes/sheets/sync-categories.ts rename to src/api/routes/admin/sheets/sync-categories.ts index 5908f2d..d1ae541 100644 --- a/src/api/routes/sheets/sync-categories.ts +++ b/src/api/routes/admin/sheets/sync-categories.ts @@ -1,7 +1,7 @@ import { authenticate } from "@medusajs/medusa" import express, { Router } from "express"; -import CategoryService from "../../../services/category"; -import GoogleSheetAPIService from "../../../services/google-sheet-api"; +import CategoryService from "../../../../services/category"; +import GoogleSheetAPIService from "../../../../services/google-sheet-api"; export const SheetsSyncCategoriesRouter = (router: Router) => { diff --git a/src/api/routes/sheets/sync-locations.ts b/src/api/routes/admin/sheets/sync-locations.ts similarity index 88% rename from src/api/routes/sheets/sync-locations.ts rename to src/api/routes/admin/sheets/sync-locations.ts index 5592346..ec57415 100644 --- a/src/api/routes/sheets/sync-locations.ts +++ b/src/api/routes/admin/sheets/sync-locations.ts @@ -1,7 +1,7 @@ import { authenticate } from "@medusajs/medusa"; import express, { Router } from "express"; -import CategoryService from "../../../services/category"; -import GoogleSheetAPIService from "../../../services/google-sheet-api"; +import CategoryService from "../../../../services/category"; +import GoogleSheetAPIService from "../../../../services/google-sheet-api"; export const SheetsSyncLocationsRouter = (router: Router) => { diff --git a/src/api/routes/sheets/sync-products.ts b/src/api/routes/admin/sheets/sync-products.ts similarity index 88% rename from src/api/routes/sheets/sync-products.ts rename to src/api/routes/admin/sheets/sync-products.ts index 079ade8..abfcbc4 100644 --- a/src/api/routes/sheets/sync-products.ts +++ b/src/api/routes/admin/sheets/sync-products.ts @@ -1,7 +1,7 @@ import { authenticate } from "@medusajs/medusa" import express, { Router } from "express"; -import GoogleSheetAPIService from "../../../services/google-sheet-api"; -import ProductService from "../../../services/product"; +import GoogleSheetAPIService from "../../../../services/google-sheet-api"; +import ProductService from "../../../../services/product"; export const SheetsSyncProductsRouter = (router: Router) => {