Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
pill_minder
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
Phuengton Chummuel
pill_minder
Commits
c7d2068c
Commit
c7d2068c
authored
Mar 22, 2018
by
Phuengton Chummuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change action in reminderAction.js
parent
72092594
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
reminderAction.js
src/actions/reminderAction.js
+12
-11
No files found.
src/actions/reminderAction.js
View file @
c7d2068c
...
...
@@ -8,20 +8,21 @@ import realm from './../Database/'
import
moment
from
'moment'
import
{
ToastAndroid
}
from
'react-native'
export
const
reminderCreate
=
({
id
,
doctorName
,
date
,
place
,
tim
e
})
=>
{
export
const
reminderCreate
=
({
id
,
medName
,
reminderTime
,
meal
,
period
,
dos
e
})
=>
{
return
(
dispatch
)
=>
{
let
appointment
=
{
id
,
doctorName
,
date
,
place
,
time
}
realm
.
write
(()
=>
{
realm
.
create
(
'Reminder'
,
{
id
:
id
,
doctorName
:
doctorName
,
date
:
date
,
place
:
place
,
medName
:
medName
,
reminderTime
:
reminderTime
,
meal
:
meal
,
period
:
period
,
dose
:
dose
,
timeStamp
:
moment
().
toDate
()
})
})
let
appointment
s
=
realm
.
objects
(
"Reminder"
)
dispatch
({
type
:
APPOINTMENT_CREATE
,
payload
:
appointment
s
})
let
reminder
s
=
realm
.
objects
(
"Reminder"
)
dispatch
({
type
:
REMINDER_CREATE
,
payload
:
reminder
s
})
}
}
...
...
@@ -33,8 +34,8 @@ export const reminderUpdate = () => {
export
const
reminderFetch
=
()
=>
{
return
(
dispatch
)
=>
{
let
appointment
s
=
realm
.
objects
(
"Reminder"
)
dispatch
({
type
:
APPOINTMENT_FETCH
,
payload
:
appointment
s
})
let
reminder
s
=
realm
.
objects
(
"Reminder"
)
dispatch
({
type
:
REMINDER_FETCH
,
payload
:
reminder
s
})
}
}
...
...
@@ -44,7 +45,7 @@ export const reminderDelete = (id) => {
realm
.
write
(()
=>
{
realm
.
delete
(
item
)
})
let
appointment
s
=
realm
.
objects
(
"Reminder"
)
dispatch
({
type
:
APPOINTMENT_DELETE
,
payload
:
appointment
s
})
let
reminder
s
=
realm
.
objects
(
"Reminder"
)
dispatch
({
type
:
REMINDER_DELETE
,
payload
:
reminder
s
})
}
}
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