change storage manager request method to PATCH
Question
Hey @artf does the storage manager support changing the request method from post to patch? I did not see that anywehre in the docs.
Answers (3)
Hi @artf ! I just started using GrapesJS (awesome plug-in btw, thank you so much!) and I'm wondering whether this has been added or not?
:+1: As per source code it's not supported but it should for sure. Semantically POST creates resources, while storage is actually updating it. So PUT or PATCH are more valid IMHO.
Anyway, the best is to provide ability to let you decide which method should be used while sending "update" requests.
Anyway, the best is to provide ability to let you decide which method should be used while sending "update" requests.
I agree...
Probably I'll add this option (storageManager module) in the next release:
storageManager: {
...
// Pass custom options to fetch API (remote storage)
// You can pass a simple object: { someOption: 'someValue' }
// or a function wich returns and object to add:
// currentOpts => {
// return currentOpts.method === 'post' ? { method: 'patch' } : {};
// }
fetchOptions: '',
},
So, in this case, you'll be able to distinguish the type of the call (store/load) by currentOpts.method === 'post' and decide what option to add. Not super elegant but at least will work for most of the cases, will not gonna break the current implementation and works also for other fetch options
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1615
[Feature] support edit credentials request attribute on Remote Storage
The credentials options its forced to be 'include' on Remote Storage. https://github.com/artf/grapesjs/blob/master/src/storage_manager/mode...
Issue #3376
Changing upload URL for AssetManager programmatically
I've got an situation where depending on how the Asset Manager is opened I want to pass a slightly different upload URL. In the asset:uploa...
Issue #3733
BUG: (or just general issue) storage manager does not load coorectly?
WARNING READ and FOLLOW next 3 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grape...
Issue #3283
BUG: BlocksView rendering is being called twice
https://github.com/artf/grapesjs/blob/b199083f6a6128ecff41d20865493294f71fe0a1/src/block_manager/view/BlocksView.js#L186 The Block Manager...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.