edit submission request init
This commit is contained in:
parent
d26a91b65c
commit
cfeac6b920
25
src/api/editSubmission.js
Normal file
25
src/api/editSubmission.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import KeyCloakService from '../services/KeyCloakService';
|
||||||
|
import { API } from '../utils/globals';
|
||||||
|
|
||||||
|
const editSubmission = (
|
||||||
|
submisssion,
|
||||||
|
tags,
|
||||||
|
description
|
||||||
|
) => {
|
||||||
|
// tags = tags.map((tag) => tag.name).join(',');
|
||||||
|
tags = tags.replaceAll(',', '%2C');
|
||||||
|
fetch(`${API}/edit-submission/${submisssion}/${tags}/${description}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
Authorization: `Bearer ${KeyCloakService.getToken()}`,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((resp) => resp.text())
|
||||||
|
.then((data) => {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default editSubmission;
|
||||||
|
// http://localhost:3000/api/edit-submission/4/1%2C2/abc
|
@ -9,6 +9,7 @@ import theme from '../../../utils/theme';
|
|||||||
import DeletePopUp from './components/DeletePopUp/DeletePopUp';
|
import DeletePopUp from './components/DeletePopUp/DeletePopUp';
|
||||||
import MobileTable from './components/MobileTable/MobileTable';
|
import MobileTable from './components/MobileTable/MobileTable';
|
||||||
import Media from 'react-media';
|
import Media from 'react-media';
|
||||||
|
import editSubmission from '../../../api/editSubmission';
|
||||||
|
|
||||||
const Table = ({
|
const Table = ({
|
||||||
items,
|
items,
|
||||||
@ -48,7 +49,7 @@ const Table = ({
|
|||||||
item={item}
|
item={item}
|
||||||
setDeletePopUp={setDeletePopUp}
|
setDeletePopUp={setDeletePopUp}
|
||||||
deletePopUp={deletePopUp}
|
deletePopUp={deletePopUp}
|
||||||
deleteItem={deleteItem}
|
deleteItem={() => editSubmission(7355, '1,2,3', 'ssiema siema')}
|
||||||
/>
|
/>
|
||||||
<TableRowItems orderedKeys={orderedKeys} item={item} i={i} />
|
<TableRowItems orderedKeys={orderedKeys} item={item} i={i} />
|
||||||
<TableRowFooter
|
<TableRowFooter
|
||||||
|
@ -111,6 +111,7 @@ const AllEntries = (props) => {
|
|||||||
|
|
||||||
const n = (pageNr - 1) * (ELEMENTS_PER_PAGE * 2);
|
const n = (pageNr - 1) * (ELEMENTS_PER_PAGE * 2);
|
||||||
let elements = entries.slice(n, n + ELEMENTS_PER_PAGE * 2);
|
let elements = entries.slice(n, n + ELEMENTS_PER_PAGE * 2);
|
||||||
|
console.log(elements);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FlexColumn
|
<FlexColumn
|
||||||
|
Loading…
Reference in New Issue
Block a user