Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
clone_excelso
Commits
cb49347b
Commit
cb49347b
authored
Jun 04, 2020
by
Afid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set note
parent
7365e5fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
globalReducer.js
redux/globalReducer.js
+20
-12
No files found.
redux/globalReducer.js
View file @
cb49347b
...
@@ -706,20 +706,28 @@ const rootReducer = (state = globalState, action) => {
...
@@ -706,20 +706,28 @@ const rootReducer = (state = globalState, action) => {
}
}
case
ActionType
.
SET_EDIT_NOTE
:
{
case
ActionType
.
SET_EDIT_NOTE
:
{
const
item
=
action
.
data
.
item
;
const
update
=
action
.
data
.
item
;
// const new_quantity = action.data.new_quantity;
// let total = 0
let
list_item
=
[]
let
edit_qty
=
list_item
.
find
(
item
=>
item
.
id
==
item
.
note
)
console
.
log
(
"INI APA YA : "
+
edit_qty
)
// list_menu.push()
updated_data
=
[]
for
(
let
i
=
0
;
i
<
state
.
order_item
.
length
;
i
++
)
{
const
old_data
=
state
.
order_item
[
i
];
const
data
=
old_data
;
// return {
// dicari dulu yu object mana yg mau diupdate
// ...state,
if
(
old_data
.
id
==
update
.
id
)
{
// order_item: list_item,
// kalo ketemu update data notenya
// }
data
.
note
=
update
.
note
updated_data
.
push
(
data
)
}
else
{
// kalo bukan biarin pakai yg lama
updated_data
.
push
(
data
)
}
}
return
{
...
state
,
order_item
:
updated_data
,
}
}
}
...
...
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