feature/IO-3255-simplified-parts-management - Checkpoint

This commit is contained in:
Dave Richer
2025-06-18 11:22:23 -04:00
parent 8af6c8dd24
commit 4b75504d9e
10 changed files with 638 additions and 280 deletions

View File

@@ -1,4 +1,3 @@
const crypto = require("crypto");
const admin = require("firebase-admin");
const client = require("../../graphql-client/graphql-client").client;
const DefaultNewShop = require("./defaultNewShop.json");
@@ -243,11 +242,17 @@ const partsManagementProvisioning = async (req, res) => {
// Cleanup on failure
if (err.userRecord) {
await deleteFirebaseUser(err.userRecord.uid).catch(() => {});
await deleteFirebaseUser(err.userRecord.uid).catch(() => {
// Ignore errors during user deletion cleanup
});
}
if (err.newShopId) {
await deleteVendorsByShop(err.newShopId).catch(() => {});
await deleteBodyshop(err.newShopId).catch(() => {});
await deleteVendorsByShop(err.newShopId).catch(() => {
// Ignore errors during vendor deletion cleanup
});
await deleteBodyshop(err.newShopId).catch(() => {
// Ignore errors during shop deletion cleanup
});
}
return res.status(err.status || 500).json({ error: err.message || "Internal server error" });