Skip to content

Commit 38bb3ea

Browse files
committed
date removed from tparts 3 and 4
1 parent 4570050 commit 38bb3ea

File tree

8 files changed

+9
-31
lines changed

8 files changed

+9
-31
lines changed

src/content/10/en/part10a.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,8 @@ Let us now run the script _npm start_
9090
>error:03000086:digital envelope routines::initialization
9191
>```
9292
>
93-
> <i>change the package.json as follows</i>
94-
>
95-
>```javascript
96-
>{
97-
> // ...
98-
> "scripts": {
99-
> "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && expo start", // highlight-line
100-
> "android": "expo start --android",
101-
> "ios": "expo start --ios",
102-
> "web": "expo start --web"
103-
> },
104-
> // ...
105-
>}
106-
>```
93+
> <i>the problem is most likely your Node version. In case of problems, switch to version _16.19.0_. See eg. [here](https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported) for more.</i>
94+
10795
10896
The script starts the [Metro bundler](https://facebook.github.io/metro/) which is a JavaScript bundler for React Native. It can be described as the [Webpack](https://webpack.js.org/) of the React Native ecosystem. In addition to the Metro bundler, the Expo command-line interface should be open in the terminal window. The command-line interface has a useful set of commands for viewing the application logs and starting the application in an emulator or in Expo's mobile application. We will get to emulators and Expo's mobile application soon, but first, let's open our application.
10997

src/content/10/en/part10b.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ const HelloWorld = props => {
4141

4242
So we import the [Text](https://reactnative.dev/docs/text) component from React Native and replace the *div* element with a *Text* element. Many familiar DOM elements have their React Native "counterparts". Here are some examples picked from React Native's [Core Components documentation](https://reactnative.dev/docs/components-and-apis):
4343

44-
- [Text](https://reactnative.dev/docs/text) component is <i>the only</i> React Native component that can have textual children. It is similar to for example the `<strong>` and the `<h1>` elements.
45-
- [View](https://reactnative.dev/docs/view) component is the basic user interface building block similar to the `<div>` element.
46-
- [TextInput](https://reactnative.dev/docs/textinput) component is a text field component similar to the `<input>` element.
47-
- [Pressable](https://reactnative.dev/docs/pressable) component is for capturing different press events. It is similar to for example the `<button>` element.
44+
- [Text](https://reactnative.dev/docs/text) component is <i>the only</i> React Native component that can have textual children. It is similar to for example the _&lt;strong&gt;_ and the _&lt;h1&gt;_ elements.
45+
- [View](https://reactnative.dev/docs/view) component is the basic user interface building block similar to the _&lt;div&gt;_ element.
46+
- [TextInput](https://reactnative.dev/docs/textinput) component is a text field component similar to the _&lt;input&gt;_ element.
47+
- [Pressable](https://reactnative.dev/docs/pressable) component is for capturing different press events. It is similar to for example the _&lt;button&gt;_ element.
4848

4949
There are a few notable differences between core components and DOM elements. The first difference is that the <em>Text</em> component is <i>the only</i> React Native component that can have textual children. This means that you can't, for example, replace the <em>Text</em> component with the <em>View</em> component in the previous example.
5050

51-
The second notable difference is related to the event handlers. While working with the DOM elements we are used to adding event handlers such as <em>onClick</em> to basically any element such as `<div>` and `<button>`. In React Native we have to carefully read the [API documentation](https://reactnative.dev/docs/components-and-apis) to know what event handlers (as well as other props) a component accepts. For example, the [Pressable](https://reactnative.dev/docs/pressable) component provides props for listening to different kinds of press events. We can for example use the component's [onPress](https://reactnative.dev/docs/pressable) prop for listening to press events:
51+
The second notable difference is related to the event handlers. While working with the DOM elements we are used to adding event handlers such as <em>onClick</em> to basically any element such as _&lt;div&gt;_ and _&lt;button&gt;_. In React Native we have to carefully read the [API documentation](https://reactnative.dev/docs/components-and-apis) to know what event handlers (as well as other props) a component accepts. For example, the [Pressable](https://reactnative.dev/docs/pressable) component provides props for listening to different kinds of press events. We can for example use the component's [onPress](https://reactnative.dev/docs/pressable) prop for listening to press events:
5252

5353
```javascript
5454
import { Text, Pressable, Alert } from 'react-native';

src/content/3/en/part3a.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,6 @@ app.post('/api/notes', (request, response) => {
775775
const note = {
776776
content: body.content,
777777
important: body.important || false,
778-
date: new Date(),
779778
id: generateId(),
780779
}
781780

src/content/3/en/part3d.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ app.post('/api/notes', (request, response, next) => { // highlight-line
5858
const note = new Note({
5959
content: body.content,
6060
important: body.important || false,
61-
date: new Date(),
6261
})
6362

6463
note.save()

src/content/3/fi/osa3d.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ app.post('/api/notes', (request, response, next) => { // highlight-line
5454
const note = new Note({
5555
content: body.content,
5656
important: body.important || false,
57-
date: new Date(),
5857
})
5958

6059
note.save()

src/content/4/en/part4a.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ notesRouter.post('/', (request, response, next) => {
124124
const note = new Note({
125125
content: body.content,
126126
important: body.important || false,
127-
date: new Date()
128127
})
129128

130129
note.save()
@@ -292,10 +291,6 @@ const noteSchema = new mongoose.Schema({
292291
required: true,
293292
minlength: 5
294293
},
295-
date: {
296-
type: Date,
297-
required: true,
298-
},
299294
important: Boolean,
300295
})
301296

src/content/4/fi/osa4a.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ notesRouter.post('/', (request, response, next) => {
120120
const note = new Note({
121121
content: body.content,
122122
important: body.important || false,
123-
date: new Date(),
124123
})
125124

126125
note.save()
@@ -285,7 +284,6 @@ const noteSchema = new mongoose.Schema({
285284
required: true,
286285
minlength: 5
287286
},
288-
date: Date,
289287
important: Boolean,
290288
})
291289

src/content/4/fi/osa4c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ Huomaamme siis, että käyttäjällä on kaksi muistiinpanoa.
450450

451451
Muistiinpanon luoneen käyttäjän id tulee näkyviin muistiinpanon yhteyteen:
452452

453-
![Selain renderöi osoitteessa localhost:3001/api/notes taulukollisen JSON:eja joilla kentät content, important, date, id ja user, jonka arvo käyttäjäid](../../images/4/12e.png)
453+
![Selain renderöi osoitteessa localhost:3001/api/notes taulukollisen JSON:eja joilla kentät content, important, id ja user, jonka arvo käyttäjäid](../../images/4/12e.png)
454454

455455
### populate
456456

@@ -503,7 +503,7 @@ notesRouter.get('/', async (request, response) => {
503503

504504
Nyt käyttäjän tiedot tulevat muistiinpanon kenttään <i>user</i>:
505505

506-
![Selain renderöi osoitteessa localhost:3001/api/notes taulukollisen JSON:eja joilla kentät content, important, date, id ja user. Kenttä user on olio jolla on kentät name, username ja id](../../images/4/15new.png)
506+
![Selain renderöi osoitteessa localhost:3001/api/notes taulukollisen JSON:eja joilla kentät content, important, id ja user. Kenttä user on olio jolla on kentät name, username ja id](../../images/4/15new.png)
507507

508508
Korostetaan vielä, että tietokannan tasolla ei siis ole mitään määrittelyä sille, että esim. muistiinpanojen kenttään <i>user</i> talletetut id:t viittaavat <i>users</i>-kokoelman dokumentteihin.
509509

0 commit comments

Comments
 (0)