-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI-Planning.txt
More file actions
83 lines (36 loc) · 1.71 KB
/
Copy pathAPI-Planning.txt
File metadata and controls
83 lines (36 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
API Planning
Upon logging in, user is presented with current date. There will be no data yet.
Upon creating a task for a date with no data, we will create an date entry and create the task.
This will hit a Task Route whose first code will run an if else statement checking if the combination of the user id and the data has an entry. If it doesn't then it will create an entry and create a task for that entry.
The user will then write subtasks for that entry and then make a post request with the tasks id, adding the subtask to that task id.
After writing this, I'm wondering if an entry model is necessary. It will make it easier to grab all entries when looking at graph data...
POST
- Task -> Entry with Date + User Id exist?
Yes -> Create Task, Add Task Id to existing Entry
No -> Create Task, Create Entry and add Task Id to that Entry
- Subtask -> Use Task Id, find it through DB then Add Subtask to that Task Id
Get Entry by date which will contain all tasks and its subtasks
New Date
Click Create Task
If Entry exists,
State will contain the id of current Entry.
State also holds the array of tasks and its respective subtasks
If state is empty, then we must create Task.
So upon loading, componentDidMount will always make a retrieval request to fill the state with the tasks.
So are we making a request based on entry?
So make GET request for entry.
Response with...
Null
Or with existant entries
From here...
If we don't have any entries.... We will make one by creating a task.....
.... tbc
API
[x] GET Tasks by user
[x] GET Subtasks by Task Id
[x] POST Task
[x] POST Subtask
[x] PUT Task
[] PUT Subtask
[] Delete Task
[] Delete Subtask