mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-03 04:29:09 +01:00
fix: validations updates
This commit is contained in:
parent
83bbbe3fb3
commit
0ad0af041b
@ -797,8 +797,8 @@ export const getGlobalEnvironmentVariables = ({ globalEnvironments, activeGlobal
|
||||
const environment = globalEnvironments?.find(env => env?.uid === activeGlobalEnvironmentUid);
|
||||
if (environment) {
|
||||
each(environment.variables, (variable) => {
|
||||
if (variable.name && variable.value && variable.enabled) {
|
||||
variables[variable.name] = variable.value;
|
||||
if (variable.name && variable.enabled) {
|
||||
variables[variable.name] = variable.value || '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -173,4 +173,4 @@ export const generateUidBasedOnHash = (str) => {
|
||||
return `${hash}`.padEnd(21, '0');
|
||||
};
|
||||
|
||||
export const stringifyIfNot = v => typeof v === 'string' ? v : String(v);
|
||||
export const stringifyIfNot = v => typeof v === 'string' ? v : '';
|
||||
|
@ -79,9 +79,9 @@ export const transformItemsInCollection = (collection) => {
|
||||
// from 5 feb 2024, multipartFormData needs to have a type
|
||||
// this was introduced when we added support for file uploads
|
||||
// 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) {
|
||||
_.each(multipartFormData, (form) => {
|
||||
each(multipartFormData, (form) => {
|
||||
if (!form.type) {
|
||||
form.type = 'text';
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class GlobalEnvironmentsStore {
|
||||
return globalEnvironments?.map(env => {
|
||||
const variables = env.variables?.map(v => ({
|
||||
...v,
|
||||
value: v?.secret ? (this.isValidValue(v.value) ? encryptString(v.value) : '') : v?.value
|
||||
value: v?.secret ? (this.isValidValue(v.value) ? encryptString(v.value) : '') : (v?.value || '')
|
||||
})) || [];
|
||||
|
||||
return {
|
||||
@ -32,7 +32,7 @@ class GlobalEnvironmentsStore {
|
||||
return globalEnvironments?.map(env => {
|
||||
const variables = env.variables?.map(v => ({
|
||||
...v,
|
||||
value: v?.secret ? (this.isValidValue(v.value) ? decryptString(v.value) : '') : v?.value
|
||||
value: v?.secret ? (this.isValidValue(v.value) ? decryptString(v.value) : '') : (v?.value || '')
|
||||
})) || [];
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user