diff options
| author | jc0b <j@jc0b.computer> | 2020-07-21 21:22:03 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:02 +0200 |
| commit | 5b4ab37ac7be2b2c34e2fad928b0cd7f3a837263 (patch) | |
| tree | b7720e8b8e7934de884768caceb59080c2efd087 /frontend/src/actions | |
| parent | d8479e7e3744b8d1d31ac4d9f972e560eacd2cf8 (diff) | |
prefab start
Diffstat (limited to 'frontend/src/actions')
| -rw-r--r-- | frontend/src/actions/modals/prefabs.js | 14 | ||||
| -rw-r--r-- | frontend/src/actions/prefabs.js | 45 |
2 files changed, 59 insertions, 0 deletions
diff --git a/frontend/src/actions/modals/prefabs.js b/frontend/src/actions/modals/prefabs.js new file mode 100644 index 00000000..826565d2 --- /dev/null +++ b/frontend/src/actions/modals/prefabs.js @@ -0,0 +1,14 @@ +export const OPEN_NEW_PREFAB_MODAL = 'OPEN_NEW_PREFAB_MODAL' +export const CLOSE_NEW_PREFAB_MODAL = 'CLOSE_PREFAB_MODAL' + +export function openNewPrefabModal() { + return { + type: OPEN_NEW_PREFAB_MODAL, + } +} + +export function closeNewPrefabModal() { + return { + type: CLOSE_NEW_PREFAB_MODAL, + } +} diff --git a/frontend/src/actions/prefabs.js b/frontend/src/actions/prefabs.js new file mode 100644 index 00000000..3f1558ce --- /dev/null +++ b/frontend/src/actions/prefabs.js @@ -0,0 +1,45 @@ +export const ADD_PREFAB = 'ADD_PREFAB' +export const ADD_PREFAB_SUCCEEDED = 'ADD_PREFAB_SUCCEEDED' +export const DELETE_PREFAB = 'DELETE_PREFAB' +export const DELETE_PREFAB_SUCCEEDED = 'DELETE_PREFAB_SUCCEEDED' +export const OPEN_PREFAB_SUCCEEDED = 'OPEN_PREFAB_SUCCEEDED' + + +export function addPrefab(name) { + return (dispatch, getState) => { + const { auth } = getState() + dispatch({ + type: ADD_PREFAB, + name, + userId: auth.userId, + }) + } +} + +export function addPrefabSucceeded(authorization) { + return { + type: ADD_PREFAB_SUCCEEDED, + authorization, + } +} + +export function deletePrefab(id) { + return { + type: DELETE_PREFAB, + id, + } +} + +export function deletePrefabSucceeded(id) { + return { + type: DELETE_PREFAB_SUCCEEDED, + id, + } +} + +export function openPrefabSucceeded(id) { + return { + type: OPEN_PREFAB_SUCCEEDED, + id, + } +} |
