tycho-components 0.0.5-SNAPSHOT-3 → 0.0.5
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.
|
@@ -41,7 +41,7 @@ export default function Participants({ document, participants, onChange, }) {
|
|
|
41
41
|
if (participants.length > 0)
|
|
42
42
|
setParticipant(participants[0]);
|
|
43
43
|
}, []);
|
|
44
|
-
return (_jsxs("div", { className: "participants-container", children: [_jsxs("div", { className: "header", children: [_jsx("h3", { children: t('label.title') }), _jsx("div", { className: "actions", children: _jsxs("button", { type: "button", className: "action", onClick: () => setOpenCreate(true), children: [_jsx(FontAwesomeIcon, { icon: faPlus, title: t('button.label.add') }), _jsx("span", { className: "ms-2", children: t('button.label.add') })] }) })] }), _jsx("div", { className: "body", children: participant && (_jsxs(_Fragment, { children: [_jsx(Form.Select, { onChange: (e) => setParticipant(participants[Number(e.target.value)]), children: participants.map((el, idx) => (_jsx("option", { value: idx, children: `${el.code} - ${el.name}` }, idx))) }), _jsx(AppEditable, { translation: "participants", group: "participant", save: handleSave, item: { ...participant, uid: document }, fields: PARTICIPANT_FIELDS, className: "fields", reference: "code" }), _jsx("div", { className: "footer", children: _jsxs(Button, { variant: "danger", onClick: () => {
|
|
44
|
+
return (_jsxs("div", { className: "participants-container", children: [_jsxs("div", { className: "header", children: [_jsx("h3", { children: t('label.title') }), _jsx("div", { className: "actions", children: _jsxs("button", { type: "button", className: "action", onClick: () => setOpenCreate(true), children: [_jsx(FontAwesomeIcon, { icon: faPlus, title: t('button.label.add') }), _jsx("span", { className: "ms-2", children: t('button.label.add') })] }) })] }), _jsx("div", { className: "body", children: participant && (_jsxs(_Fragment, { children: [_jsx(Form.Select, { onChange: (e) => setParticipant(participants[Number(e.target.value)]), children: participants.map((el, idx) => (_jsx("option", { value: idx, selected: el.code === participant.code, children: `${el.code} - ${el.name}` }, idx))) }), _jsx(AppEditable, { translation: "participants", group: "participant", save: handleSave, item: { ...participant, uid: document }, fields: PARTICIPANT_FIELDS, className: "fields", reference: "code" }), _jsx("div", { className: "footer", children: _jsxs(Button, { variant: "danger", onClick: () => {
|
|
45
45
|
setParticipant(participant);
|
|
46
46
|
setOpenRemove(true);
|
|
47
47
|
}, children: [_jsx(FontAwesomeIcon, { icon: faTrash }), _jsx("span", { className: "ms-1", children: t('common:button.remove') })] }) })] })) }), participant && openRemove && (_jsx(ParticipantRemove, { document: document, onChange: (list) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import api from '../../configs/api';
|
|
2
2
|
function add(uid, request) {
|
|
3
|
-
return api.post(
|
|
3
|
+
return api.post(`${import.meta.env.VITE_APP_CATALOG_API}/participant/${uid}`, request);
|
|
4
4
|
}
|
|
5
5
|
function update(field) {
|
|
6
|
-
return api.patch(
|
|
6
|
+
return api.patch(`${import.meta.env.VITE_APP_CATALOG_API}/participant/update`, field);
|
|
7
7
|
}
|
|
8
8
|
function remove(document, code) {
|
|
9
|
-
return api.delete(
|
|
9
|
+
return api.delete(`${import.meta.env.VITE_APP_CATALOG_API}/participant/${document}/${code}`);
|
|
10
10
|
}
|
|
11
11
|
const ParticipantService = { add, update, remove };
|
|
12
12
|
export default ParticipantService;
|