mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-07 16:44:27 +01:00
fix: fixed issues with creating patch requests
This commit is contained in:
parent
e1b97643bd
commit
17ded5de4c
@ -25,7 +25,7 @@ const NewFolder = ({ collection, item, onClose }) => {
|
||||
if(item && item.uid) {
|
||||
return true;
|
||||
}
|
||||
return !(value.trim().toLowerCase().includes('environments'))
|
||||
return value && !(value.trim().toLowerCase().includes('environments'))
|
||||
}
|
||||
})
|
||||
}),
|
||||
|
@ -30,7 +30,7 @@ const NewRequest = ({ collection, item, isEphermal, onClose }) => {
|
||||
.test({
|
||||
name: 'requestName',
|
||||
message: 'The request name "index" is reserved in bruno',
|
||||
test: value => !(value.trim().toLowerCase().includes('index')),
|
||||
test: value => value && !(value.trim().toLowerCase().includes('index')),
|
||||
})
|
||||
}),
|
||||
onSubmit: (values) => {
|
||||
|
@ -57,11 +57,12 @@ const grammar = ohm.grammar(`Bru {
|
||||
|
||||
meta = "meta" dictionary
|
||||
|
||||
http = get | post | put | delete | options | head | connect | trace
|
||||
http = get | post | put | delete | patch | options | head | connect | trace
|
||||
get = "get" dictionary
|
||||
post = "post" dictionary
|
||||
put = "put" dictionary
|
||||
delete = "delete" dictionary
|
||||
patch = "patch" dictionary
|
||||
options = "options" dictionary
|
||||
head = "head" dictionary
|
||||
connect = "connect" dictionary
|
||||
@ -237,6 +238,14 @@ const sem = grammar.createSemantics().addAttribute('ast', {
|
||||
}
|
||||
};
|
||||
},
|
||||
patch(_1, dictionary) {
|
||||
return {
|
||||
http: {
|
||||
method: 'patch',
|
||||
...mapPairListToKeyValPair(dictionary.ast)
|
||||
}
|
||||
};
|
||||
},
|
||||
options(_1, dictionary) {
|
||||
return {
|
||||
http: {
|
||||
|
Loading…
Reference in New Issue
Block a user