You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/0/en/part0a.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,7 @@ By submitting all exercises for part 13 of the course on Relational databases, y
174
174
175
175
How to study the course – instructions in a nutshell: 5 cr core course CSM141081
176
176
177
-
- Do the exercises. The exercises are submitted through GitHub and marking them as done on the [submission system](https://studies.cs.helsinki.fi/stats/courses/fullstackopen).
177
+
- Do the exercises. The exercises are submitted through GitHub and marking them is done on the [submission system](https://studies.cs.helsinki.fi/stats/courses/fullstackopen).
178
178
- [The course certificate](/en/part0/general_info#course-certificate) will be available in the submission system
179
179
- If you want to get University of Helsinki credits
180
180
- Enroll in the course. You will get the enrollment link through the submission system once you have completed enough exercises. Read more [here](/en/part0/general_info#submitting-exercises)
@@ -186,7 +186,7 @@ Please note that if you do the "base course" with 6 or 7 credits, you need separ
186
186
187
187
How to study the course – instructions in a nutshell: other course parts
188
188
189
-
- Do the exercises. The exercises are submitted through GitHub and marking them as done on the submission system. Note that parts 8-13 have a separate instance in the submission system
189
+
- Do the exercises. The exercises are submitted through GitHub and marking them is done on the submission system. Note that parts 8-13 have a separate instance in the submission system
190
190
- [The course certificate](/en/part0/general_info#course-certificate) will be available in the submission system
191
191
- If you want to get University of Helsinki credits
192
192
- Enroll in the course. You can enroll in each part through the link in the course material ([Parts and completion](/en/part0/general_info#parts-and-completion)). Enroll in each part separately.
Copy file name to clipboardExpand all lines: src/content/1/fi/osa1d.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -318,7 +318,7 @@ Konsoli paljastaa ongelman
318
318
319
319

320
320
321
-
Vaikka tilalle _left_ asetettiin uusi arvo kutsumalla _setLeft(left + 1)_ on tilalla siis tapahtumankäsittelijän sisällä edelleen vanha arvo päivityksestä huolimatta! Tämän takia seuraava takia nappien painallusten laskuyritys tuottaa aina yhtä liian pienen tuloksen:
321
+
Vaikka tilalle _left_ asetettiin uusi arvo kutsumalla _setLeft(left + 1)_ on tilalla siis tapahtumankäsittelijän sisällä edelleen vanha arvo päivityksestä huolimatta! Tämän takia seuraava nappien painallusten laskuyritys tuottaa aina yhtä liian pienen tuloksen:
@@ -781,7 +781,7 @@ Now the result is exactly what we want:
781
781
In the case of a collection of objects, the method toJSON does not work directly, the method must be called separately for each object in the collection:
@@ -806,7 +806,7 @@ The print looks like the following:
806
806
However, perhaps a better solution is to turn the collection into JSON for printing by using the method [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify):
Copy file name to clipboardExpand all lines: src/content/2/en/part2c.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -362,7 +362,7 @@ What's not immediately obvious, however, is where the command <em>axios.get</em>
362
362
363
363
### Effect-hooks
364
364
365
-
We have already used [state hooks](https://react.dev/learn/state-a-components-memory) that were introduced along with React version [16.8.0](https://www.npmjs.com/package/react/v/16.8.0), which provide state to React components defined as functions - the so-called <i>functional components</i>. Version 16.8.0 also introduces [effect hooks](https://reactjs.org/docs/hooks-effect.html) as a new feature. As per the official docs:
365
+
We have already used [state hooks](https://react.dev/learn/state-a-components-memory) that were introduced along with React version [16.8.0](https://www.npmjs.com/package/react/v/16.8.0), which provide state to React components defined as functions - the so-called <i>functional components</i>. Version 16.8.0 also introduces [effect hooks](https://react.dev/reference/react#effect-hooks) as a new feature. As per the official docs:
366
366
367
367
> <i>The Effect Hook lets you perform side effects on function components.</i>
368
368
> <i>Data fetching, setting up a subscription, and manually changing the DOM in React components are all examples of side effects.</i>
This is not recommended because the variable <em>note</em> is a reference to an item in the <em>notes</em> array in the component's state, and as we recall we must [never mutate state directly](https://reactjs.org/docs/state-and-lifecycle.html#using-state-correctly) in React.
236
+
This is not recommended because the variable <em>note</em> is a reference to an item in the <em>notes</em> array in the component's state, and as we recall we must [never mutate state directly](https://react.dev/learn/updating-objects-in-state#why-is-mutating-state-not-recommended-in-react) in React.
237
237
238
238
It's also worth noting that the new object _changedNote_ is only a so-called [shallow copy](https://en.wikipedia.org/wiki/Object_copying#Shallow_copy), meaning that the values of the new object are the same as the values of the old object. If the values of the old object were objects themselves, then the copied values in the new object would reference the same objects that were in the old object.
Copy file name to clipboardExpand all lines: src/content/3/en/part3a.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -883,6 +883,10 @@ Implement a page at the address <http://localhost:3001/info> that looks roughly
883
883

884
884
885
885
The page has to show the time that the request was received and how many entries are in the phonebook at the time of processing the request.
886
+
887
+
Proposed Addition: There can only be one response.send() statement in an Express app route. Once you send a response to the client using response.send(), the request-response cycle is complete and no further response can be sent.
888
+
889
+
To include a line space in the output, use <br/> tag, or wrap the statements in <p> tags.
Copy file name to clipboardExpand all lines: src/content/3/en/part3c.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -400,7 +400,7 @@ One way to format the objects returned by Mongoose is to [modify](https://stacko
400
400
401
401
To modify the method we need to change the configurable options of the schema, options can be changed using the set method of the schema, see here for more info on this method: https://mongoosejs.com/docs/guide.html#options. See <https://mongoosejs.com/docs/guide.html#toJSON> and <https://mongoosejs.com/docs/api.html#document_Document-toObject> for more info on the _toJSON_ option.
402
402
403
-
see <https://mongoosejs.com/docs/api.html#transform> for more info on the _transform_ function.
403
+
see <https://mongoosejs.com/docs/api/document.html#transform> for more info on the _transform_ function.
We notice that the backend has now a problem: validations are not done when editing a note.
88
-
The [documentation](https://github.com/blakehaswell/mongoose-unique-validator#find--updates)explains what is the problem, validations are not run by default when <i>findOneAndUpdate</i> is executed.
88
+
The [documentation](https://github.com/blakehaswell/mongoose-unique-validator#find--updates)addresses the issue by explaining that validations are not run by default when <i>findOneAndUpdate</i> is executed.
89
89
90
90
The fix is easy. Let us also reformulate the route code a bit:
0 commit comments