Merge pull request #3670 from lohxt1/fix/validations

fix: validations
This commit is contained in:
lohit 2024-12-17 11:14:42 +05:30 committed by GitHub
commit db90d31b3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -191,7 +191,7 @@ export const globalEnvironmentsUpdateEvent = ({ globalEnvironmentVariables }) =>
// update existing values // update existing values
variables = variables?.map?.(variable => ({ variables = variables?.map?.(variable => ({
...variable, ...variable,
value: stringifyIfNot(globalEnvironmentVariables?.[variable?.name]) value: globalEnvironmentVariables?.[variable?.name]
})); }));
// add new env values // add new env values
@ -201,7 +201,7 @@ export const globalEnvironmentsUpdateEvent = ({ globalEnvironmentVariables }) =>
variables.push({ variables.push({
uid: uuid(), uid: uuid(),
name: key, name: key,
value: stringifyIfNot(value), value,
type: 'text', type: 'text',
secret: false, secret: false,
enabled: true enabled: true

View File

@ -797,7 +797,7 @@ export const getGlobalEnvironmentVariables = ({ globalEnvironments, activeGlobal
const environment = globalEnvironments?.find(env => env?.uid === activeGlobalEnvironmentUid); const environment = globalEnvironments?.find(env => env?.uid === activeGlobalEnvironmentUid);
if (environment) { if (environment) {
each(environment.variables, (variable) => { each(environment.variables, (variable) => {
if (variable.name && variable.value && variable.enabled) { if (variable.name && variable.enabled) {
variables[variable.name] = variable.value; variables[variable.name] = variable.value;
} }
}); });

View File

@ -79,9 +79,9 @@ export const transformItemsInCollection = (collection) => {
// from 5 feb 2024, multipartFormData needs to have a type // from 5 feb 2024, multipartFormData needs to have a type
// this was introduced when we added support for file uploads // this was introduced when we added support for file uploads
// below logic is to make older collection exports backward compatible // below logic is to make older collection exports backward compatible
let multipartFormData = _.get(item, 'request.body.multipartForm'); let multipartFormData = get(item, 'request.body.multipartForm');
if (multipartFormData) { if (multipartFormData) {
_.each(multipartFormData, (form) => { each(multipartFormData, (form) => {
if (!form.type) { if (!form.type) {
form.type = 'text'; form.type = 'text';
} }