Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-196
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-196
2022-196
Commits
54067b3a
Commit
54067b3a
authored
Nov 15, 2022
by
Dilip Wijethunga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admin Coins Update
parent
89bdd513
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
11 deletions
+29
-11
frontend/src/components/coins/AddCoin.js
frontend/src/components/coins/AddCoin.js
+3
-2
frontend/src/components/coins/CoinsList.js
frontend/src/components/coins/CoinsList.js
+7
-7
frontend/src/components/coins/EditCoin.js
frontend/src/components/coins/EditCoin.js
+3
-2
frontend/src/components/customer/CustomerProfile.jsx
frontend/src/components/customer/CustomerProfile.jsx
+16
-0
No files found.
frontend/src/components/coins/AddCoin.js
View file @
54067b3a
...
...
@@ -5,6 +5,7 @@ import Navbar from "../dashboard/sidebar/Navbar";
import
Form
from
"
react-validation/build/form
"
;
import
Input
from
"
react-validation/build/input
"
;
import
CurrencyDetailsService
from
"
../../services/CurrencyDetailsService
"
;
import
CommonAuthCheck
from
"
../../services/CommonAuthCheck
"
;
// TODO: Validating registration form fields
const
requiredField
=
data
=>
{
...
...
@@ -43,7 +44,7 @@ function AddCoin(props) {
CurrencyDetailsService
.
createCurrency
(
data
)
.
then
(
response
=>
{
setMessage
(
response
.
data
);
setMessage
(
response
.
data
.
data
);
setLoading
(
false
);
window
.
location
.
replace
(
"
/coins-list
"
);
})
...
...
@@ -153,4 +154,4 @@ function AddCoin(props) {
);
}
export
default
AddCoin
;
export
default
CommonAuthCheck
(
AddCoin
)
;
frontend/src/components/coins/CoinsList.js
View file @
54067b3a
...
...
@@ -4,6 +4,7 @@ import React, {useEffect, useState} from "react";
import
{
Link
}
from
"
react-router-dom
"
;
import
CurrencyDetailsService
from
"
../../services/CurrencyDetailsService
"
;
import
Modal
from
"
react-bootstrap/Modal
"
;
import
CommonAuthCheck
from
"
../../services/CommonAuthCheck
"
;
function
CoinsList
(
props
)
{
const
divBox
=
{
...
...
@@ -33,9 +34,7 @@ function CoinsList(props) {
const
handleDelete
=
async
(
id
)
=>
{
await
CurrencyDetailsService
.
deleteCurrencyById
(
id
)
.
then
(
response
=>
response
.
data
)
.
then
((
data
)
=>
{
console
.
log
(
data
)
}).
catch
(
error
=>
{
.
catch
(
error
=>
{
console
.
log
(
error
.
message
);
});
}
...
...
@@ -77,6 +76,7 @@ function CoinsList(props) {
<
/Modal.Footer
>
<
/Modal
>
<
div
style
=
{
divBox
}
/
>
<
h2
className
=
"
text-center
"
><
mark
>
All
Coins
Details
<
/mark></
h2
>
<
Container
>
<
div
>
<
Link
to
=
{
`/add-coin`
}
className
=
{
'
btn btn-success text-white
'
}
>
Add
New
Coin
<
/Link
>
...
...
@@ -113,7 +113,7 @@ function CoinsList(props) {
<
td
>
{
coin
.
name
}
<
/td
>
<
td
>
{
coin
.
code
}
<
/td
>
<
td
>
{
coin
.
description
}
<
/td
>
<
td
>
{
coin
.
image
}
<
/td
>
<
td
>
{
(
coin
.
image
).
substring
(
0
,
30
)}...
<
/td
>
<
td
>
<
Link
to
=
{{
pathname
:
process
.
env
.
PUBLIC_URL
+
'
/coin-edit
'
,
...
...
@@ -125,10 +125,10 @@ function CoinsList(props) {
coinImagePath
:
coin
.
image
}
}}
className
=
{
'
btn btn-primary
'
}
>
Edit
<
/Link
>
className
=
{
'
btn btn-primary
text-white
'
}
>
Edit
<
/Link
>
<
/td
>
<
td
>
<
Link
onClick
=
{()
=>
handleShow
(
coin
.
_id
.
$oid
)}
className
=
{
'
btn btn-danger
'
}
>
Delete
<
/Link
>
<
Link
onClick
=
{()
=>
handleShow
(
coin
.
_id
.
$oid
)}
className
=
{
'
btn btn-danger
text-white
'
}
>
Delete
<
/Link
>
<
/td
>
<
/tr
>
))
...
...
@@ -141,4 +141,4 @@ function CoinsList(props) {
);
}
export
default
Co
insList
;
export
default
Co
mmonAuthCheck
(
CoinsList
)
;
frontend/src/components/coins/EditCoin.js
View file @
54067b3a
...
...
@@ -6,6 +6,7 @@ import Form from "react-validation/build/form";
import
Input
from
"
react-validation/build/input
"
;
import
{
useLocation
}
from
"
react-router-dom
"
;
import
CurrencyDetailsService
from
"
../../services/CurrencyDetailsService
"
;
import
CommonAuthCheck
from
"
../../services/CommonAuthCheck
"
;
// TODO: Validating registration form fields
const
requiredField
=
data
=>
{
...
...
@@ -65,7 +66,7 @@ function EditCoin() {
CurrencyDetailsService
.
updateCurrency
(
data
)
.
then
(
response
=>
{
setMessage
(
response
.
data
);
setMessage
(
response
.
data
.
data
);
setLoading
(
false
);
window
.
location
.
replace
(
"
/coins-list
"
)
})
...
...
@@ -175,4 +176,4 @@ function EditCoin() {
);
}
export
default
EditCoin
;
export
default
CommonAuthCheck
(
EditCoin
)
;
frontend/src/components/customer/CustomerProfile.jsx
0 → 100644
View file @
54067b3a
import
React
from
'
react
'
;
import
NavbarCustomer
from
"
../dashboard/customer/NavbarCustomer
"
;
import
CommonCheckAuth
from
"
../../services/CommonAuthCheck
"
;
function
CustomerProfile
(
props
)
{
return
(
<
div
>
<
NavbarCustomer
/>
<
div
>
<
h1
>
Customer Profile
</
h1
>
</
div
>
</
div
>
);
}
export
default
CommonCheckAuth
(
CustomerProfile
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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