diff options
| author | ertopogo <erwin.t.pombett@gmail.com> | 2026-01-24 14:23:03 +0100 |
|---|---|---|
| committer | ertopogo <erwin.t.pombett@gmail.com> | 2026-01-24 14:23:03 +0100 |
| commit | 19c3d267fad7a29d779dda810ca5801de9e5312c (patch) | |
| tree | c1764167c1fe1ea11f8d8d64454692fca53d444f /backend/scripts/patch-medusa.js | |
| parent | e0c9c32c60b67dc34a18f5a93209393e7abc8660 (diff) | |
corrections du backend
Diffstat (limited to 'backend/scripts/patch-medusa.js')
| -rw-r--r-- | backend/scripts/patch-medusa.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/backend/scripts/patch-medusa.js b/backend/scripts/patch-medusa.js new file mode 100644 index 0000000..9d95d9a --- /dev/null +++ b/backend/scripts/patch-medusa.js @@ -0,0 +1,34 @@ +const fs = require("fs"); +const path = require("path"); + +const targetPath = path.join( + __dirname, + "..", + "node_modules", + "@medusajs", + "medusa", + "dist", + "services", + "payment-provider.js" +); + +if (!fs.existsSync(targetPath)) { + console.error("patch-medusa: cible introuvable:", targetPath); + process.exit(1); +} + +const original = fs.readFileSync(targetPath, "utf8"); +const before = "model.update({}, { is_installed: false })"; +const after = + "model.createQueryBuilder().update().set({ is_installed: false }).where('1=1').execute()"; + +if (!original.includes(before)) { + console.error( + "patch-medusa: motif introuvable, le patch n'a pas ete applique." + ); + process.exit(1); +} + +const patched = original.replace(before, after); +fs.writeFileSync(targetPath, patched, "utf8"); +console.log("patch-medusa: update vide remplace avec succes."); |
