Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
IT Project 2020
Group B
pilar-web
Commits
2ddb00e5
Commit
2ddb00e5
authored
Oct 14, 2020
by
Wan Muhammad Rayhan Arwindra
🤸🏽
Browse files
Pbi 3 batch transaksi
parent
19cee5be
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/page/batch/DetailBatch.jsx
View file @
2ddb00e5
...
...
@@ -4,13 +4,16 @@ import { css } from "@emotion/core";
import
ArrowBackIcon
from
"
@material-ui/icons/ArrowBack
"
;
import
{
navigate
}
from
"
@reach/router
"
;
import
{
stringToCurrency
,
stringToDateNoTime
}
from
"
../../component/TableUtils
"
;
import
{
ErrorDiv
}
from
"
../../component/html/html
"
;
import
{
ErrorDiv
,
ButtonDeleteStyled
}
from
"
../../component/html/html
"
;
import
LinkYellow
from
"
../../component/LinkYellow
"
;
import
useDelete
from
"
../../utils/useDelete
"
;
const
DetailBatch
=
({
batchId
})
=>
{
const
url
=
`
${
process
.
env
.
REACT_APP_BASE_URL
}
/batch/
${
batchId
}
/`
;
// const url = `http://localhost:8000/batch/${batchId}/`; // for local testing purposes
const
[
batch
,
error
]
=
useFetchSingleData
(
url
);
const
[
deleteBatch
,
errorDelete
]
=
useDelete
(
url
);
if
(
Object
.
keys
(
batch
).
length
===
0
)
return
(
...
...
@@ -39,6 +42,12 @@ const DetailBatch = ({ batchId }) => {
`
}
>
{
error
&&
<
ErrorDiv
>
Something error
</
ErrorDiv
>
}
{
errorDelete
&&
(
<
ErrorDiv
>
Tidak dapat menghapus batch, mohon periksa apakah ada transaksi
didalam batch ini.
</
ErrorDiv
>
)
}
<
div
>
<
button
css
=
{
css
`
...
...
@@ -103,6 +112,18 @@ const DetailBatch = ({ batchId }) => {
UBAH
</
LinkYellow
>
</
div
>
<
div
css
=
{
css
`
flex-grow: 1;
`
}
>
<
ButtonDeleteStyled
data-testid
=
"button-delete-category-modal"
onClick
=
{
()
=>
deleteBatch
()
}
>
HAPUS
</
ButtonDeleteStyled
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment