wip event editing
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
04b4a57e06
commit
1aa2f83f1e
1 changed files with 6 additions and 1 deletions
|
@ -221,6 +221,7 @@ const submitEvent = () =>
|
||||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
|
|
||||||
|
const id = state.compose_event.id;
|
||||||
const name = state.compose_event.name;
|
const name = state.compose_event.name;
|
||||||
const status = state.compose_event.status;
|
const status = state.compose_event.status;
|
||||||
const banner = state.compose_event.banner;
|
const banner = state.compose_event.banner;
|
||||||
|
@ -246,7 +247,11 @@ const submitEvent = () =>
|
||||||
if (banner) params.banner_id = banner.id;
|
if (banner) params.banner_id = banner.id;
|
||||||
if (location) params.location_id = location.origin_id;
|
if (location) params.location_id = location.origin_id;
|
||||||
|
|
||||||
return api(getState).post('/api/v1/pleroma/events', params).then(({ data }) => {
|
return api(getState).request({
|
||||||
|
url: id === null ? '/api/v1/pleroma/events' : `/api/v1/pleroma/events/${id}`,
|
||||||
|
method: id === null ? 'post' : 'put',
|
||||||
|
data: params,
|
||||||
|
}).then(({ data }) => {
|
||||||
dispatch(closeModal('COMPOSE_EVENT'));
|
dispatch(closeModal('COMPOSE_EVENT'));
|
||||||
dispatch(importFetchedStatus(data));
|
dispatch(importFetchedStatus(data));
|
||||||
dispatch(submitEventSuccess(data));
|
dispatch(submitEventSuccess(data));
|
||||||
|
|
Loading…
Reference in a new issue