Commit 2abd750
committed
Fix multiple posts pt2
"Refreshposts" and the "posts" template files confliceted with each other.
On user login, the "posts" template would load the latest post,
but lose the data after submitting 2 posts. Data was lost
between the addposts func and vetlogin func. The vetlogin func used
the posts template, but the addposts func used the refresh template.
Making sure the addposts and vetlogin funcs both used a single
template fixed the issue of the a single user post not
consistently showing.
To fix the issue of multiple posts not being shown required
the posts template file to take a map filled with posts and loop
over them.
Changes made to the Posts file
- rewrote the posts file to loop over a map of user posts
Changes made to the main file
- rewrote vetLogin func to render a map filled with the user's posts
along with posts tempalte
- rewrote addPosts func to render the posts template alongside a map
filled with all the user's posts.1 parent 06fde84 commit 2abd750
2 files changed
Lines changed: 41 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
| |||
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | | - | |
| 186 | + | |
174 | 187 | | |
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
178 | 191 | | |
179 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
180 | 204 | | |
181 | 205 | | |
182 | 206 | | |
183 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
184 | 210 | | |
185 | 211 | | |
186 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 25 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
0 commit comments