From 5b4ab37ac7be2b2c34e2fad928b0cd7f3a837263 Mon Sep 17 00:00:00 2001 From: jc0b Date: Tue, 21 Jul 2020 21:22:03 +0200 Subject: prefab start --- frontend/src/actions/prefabs.js | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 frontend/src/actions/prefabs.js (limited to 'frontend/src/actions/prefabs.js') 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, + } +} -- cgit v1.2.3