-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from curiosta/feat/add-user-deletion
feat: add user deletion route
- Loading branch information
Showing
13 changed files
with
170 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ package-lock.json | |
yarn.lock | ||
medusa-db.sql | ||
build | ||
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
import { Router } from "express" | ||
import { | ||
getConfigFile, | ||
} from "medusa-core-utils"; | ||
import { ConfigModule } from "@medusajs/medusa"; | ||
import cors from 'cors' | ||
import { restrictUser } from "./routes/admin/restrict-user"; | ||
|
||
export default (rootDirectory: string): Router | Router[] => { | ||
// add your custom routes here | ||
return [] | ||
} | ||
const { configModule: { projectConfig } } = getConfigFile<ConfigModule>(rootDirectory, "medusa-config") | ||
const storefrontCorsConfig = { | ||
origin: [...(projectConfig.admin_cors || "")?.split(','), ...(projectConfig.store_cors || "").split(',')], | ||
credentials: true, | ||
} | ||
|
||
const router = Router(); | ||
router.use(cors(storefrontCorsConfig)) | ||
|
||
const endpointHandlers = [restrictUser] | ||
|
||
|
||
endpointHandlers.forEach(endpointHandle => endpointHandle(router)) | ||
|
||
return router | ||
} |
Oops, something went wrong.