mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-29 06:10:47 +00:00
Fix empty strip preventing create
This commit is contained in:
@@ -179,8 +179,12 @@ const addTargetSchema = z
|
||||
return false;
|
||||
}
|
||||
// If rewritePathType is provided, rewritePath must be provided
|
||||
// Exception: stripPrefix can have an empty rewritePath (to just strip the prefix)
|
||||
if (data.rewritePathType && !data.rewritePath) {
|
||||
return false;
|
||||
// Allow empty rewritePath for stripPrefix type
|
||||
if (data.rewritePathType !== "stripPrefix") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
@@ -190,8 +190,12 @@ const addTargetSchema = z
|
||||
return false;
|
||||
}
|
||||
// If rewritePathType is provided, rewritePath must be provided
|
||||
// Exception: stripPrefix can have an empty rewritePath (to just strip the prefix)
|
||||
if (data.rewritePathType && !data.rewritePath) {
|
||||
return false;
|
||||
// Allow empty rewritePath for stripPrefix type
|
||||
if (data.rewritePathType !== "stripPrefix") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user