Address code review findings across relay, UI, and Go backend
- relay: key uploadables map by actual variable name instead of iteration index so order-mismatch between Object.keys passes can't desync the multipart map from form field names - mcp/v1: drop dead commented middleware line - DurationPicker: tighten parse regex to require PT prefix for M/H and P for D/W, and reject NaN in stringify so cleared inputs don't produce invalid duration strings Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -60,15 +60,16 @@ export const makeFetchQuery = (endpoint: string): FetchFunction => {
|
||||
const uploadableMap: {
|
||||
[key: string]: string[];
|
||||
} = {};
|
||||
const uploadableKeys = Object.keys(uploadables);
|
||||
|
||||
Object.keys(uploadables).forEach((key, index) => {
|
||||
uploadableMap[index] = [`variables.${key}`];
|
||||
uploadableKeys.forEach((key) => {
|
||||
uploadableMap[key] = [`variables.${key}`];
|
||||
});
|
||||
|
||||
formData.append("map", JSON.stringify(uploadableMap));
|
||||
|
||||
Object.keys(uploadables).forEach((key, index) => {
|
||||
formData.append(index.toString(), uploadables[key]);
|
||||
uploadableKeys.forEach((key) => {
|
||||
formData.append(key, uploadables[key]);
|
||||
});
|
||||
|
||||
requestInit.body = formData;
|
||||
|
||||
Reference in New Issue
Block a user