@selfcommunity/react-ui 0.8.0-live.45 → 0.8.0-live.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,6 @@ const lab_1 = require("@mui/lab");
|
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const styles_1 = require("@mui/material/styles");
|
|
8
8
|
const system_1 = require("@mui/system");
|
|
9
|
-
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
9
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
11
10
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
11
|
const react_1 = require("react");
|
|
@@ -123,19 +122,21 @@ function LiveStreamForm(inProps) {
|
|
|
123
122
|
if (visibilityEnabled) {
|
|
124
123
|
formData.append('visible', 'true');
|
|
125
124
|
}
|
|
125
|
+
formData.append('title', field.title);
|
|
126
126
|
formData.append('description', field.description);
|
|
127
|
-
let eventService;
|
|
128
|
-
if (liveStream) {
|
|
129
|
-
eventService = api_services_1.EventService.updateEvent(liveStream.id, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
eventService = api_services_1.EventService.createEvent(formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
133
|
-
}
|
|
134
127
|
setTimeout(() => {
|
|
135
128
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({});
|
|
136
129
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
137
130
|
}, 1000);
|
|
138
|
-
/*
|
|
131
|
+
/*
|
|
132
|
+
let eventService: Promise<SCEventType>;
|
|
133
|
+
if (liveStream) {
|
|
134
|
+
eventService = EventService.updateEvent(liveStream.id, formData as unknown as SCEventType, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
135
|
+
} else {
|
|
136
|
+
eventService = EventService.createEvent(formData, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
eventService
|
|
139
140
|
.then((data) => {
|
|
140
141
|
setField((prev) => ({...prev, ['isSubmitting']: false}));
|
|
141
142
|
// onSuccess?.(data);
|
|
@@ -4,7 +4,6 @@ import { LoadingButton } from '@mui/lab';
|
|
|
4
4
|
import { Box, FormGroup, Paper, TextField, Typography } from '@mui/material';
|
|
5
5
|
import { styled } from '@mui/material/styles';
|
|
6
6
|
import { useThemeProps } from '@mui/system';
|
|
7
|
-
import { EventService } from '@selfcommunity/api-services';
|
|
8
7
|
import { SCPreferences, useSCContext, useSCPreferences } from '@selfcommunity/react-core';
|
|
9
8
|
import classNames from 'classnames';
|
|
10
9
|
import { useCallback, useMemo, useState } from 'react';
|
|
@@ -121,19 +120,21 @@ export default function LiveStreamForm(inProps) {
|
|
|
121
120
|
if (visibilityEnabled) {
|
|
122
121
|
formData.append('visible', 'true');
|
|
123
122
|
}
|
|
123
|
+
formData.append('title', field.title);
|
|
124
124
|
formData.append('description', field.description);
|
|
125
|
-
let eventService;
|
|
126
|
-
if (liveStream) {
|
|
127
|
-
eventService = EventService.updateEvent(liveStream.id, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
eventService = EventService.createEvent(formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
131
|
-
}
|
|
132
125
|
setTimeout(() => {
|
|
133
126
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({});
|
|
134
127
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
135
128
|
}, 1000);
|
|
136
|
-
/*
|
|
129
|
+
/*
|
|
130
|
+
let eventService: Promise<SCEventType>;
|
|
131
|
+
if (liveStream) {
|
|
132
|
+
eventService = EventService.updateEvent(liveStream.id, formData as unknown as SCEventType, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
133
|
+
} else {
|
|
134
|
+
eventService = EventService.createEvent(formData, {headers: {'Content-Type': 'multipart/form-data'}});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
eventService
|
|
137
138
|
.then((data) => {
|
|
138
139
|
setField((prev) => ({...prev, ['isSubmitting']: false}));
|
|
139
140
|
// onSuccess?.(data);
|