This repository has been archived by the owner on Dec 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1402 from metasfresh/dev-1357
Update attributes & dropdown api #1357
- Loading branch information
Showing
5 changed files
with
120 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import axios from 'axios'; | ||
import { | ||
createPatchRequestPayload | ||
} from './GenericActions'; | ||
|
||
// | ||
// Handles view attributes (the panel which is displayed on the right side of a view, if view supports attributes) | ||
// Endpoints: /rest/api/documentView/{windowId}/{viewId}/{rowId}/attributes/** | ||
// | ||
|
||
export function getViewAttributesLayout(windowId, viewId, rowId) { | ||
return axios.get( | ||
config.API_URL + | ||
'/documentView'+ | ||
'/' + windowId + | ||
'/' + viewId + | ||
'/' + rowId + | ||
'/attributes/layout' | ||
); | ||
} | ||
|
||
export function getViewAttributeDropdown(windowId, viewId, rowId, attribute) { | ||
return axios.get( | ||
config.API_URL + | ||
'/documentView'+ | ||
'/' + windowId + | ||
'/' + viewId + | ||
'/' + rowId + | ||
'/attributes/attribute/' + attribute + | ||
'/dropdown' | ||
); | ||
} | ||
|
||
/** | ||
* | ||
* @param {*} windowId | ||
* @param {*} viewId | ||
* @param {*} rowId | ||
*/ | ||
export function getViewAttributes (windowId, viewId, rowId) { | ||
return axios.get( | ||
config.API_URL + | ||
'/documentView'+ | ||
'/' + windowId + | ||
'/' + viewId + | ||
'/' + rowId + | ||
'/attributes' | ||
); | ||
} | ||
|
||
export function patchViewAttributes( | ||
windowId, | ||
viewId, | ||
rowId, | ||
property, | ||
value | ||
) { | ||
const payload = createPatchRequestPayload(property, value); | ||
|
||
return axios.patch( | ||
config.API_URL + | ||
'/documentView'+ | ||
'/' + windowId + | ||
'/' + viewId + | ||
'/' + rowId + | ||
'/attributes', payload); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters