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
* feat: add merge endpoint
* formatting
* load merge too
* remove extra server
* print the data.json file
* restore the data.json from git
* add merge docs to README
If you are using [json-server](https://github.com/typicode/json-server), add this module as a middleware. For example, imagine our data file to be `data.json` with the following resources
24
26
25
27
```json
@@ -70,6 +72,30 @@ $ http :3000/todos
70
72
[]
71
73
```
72
74
75
+
### merge
76
+
77
+
Instead of overwriting the entire database with new data, you can merge the existing data with a subset (by the top key).
78
+
79
+
```
80
+
// current data
81
+
// { todos: [...], people: [...] }
82
+
```
83
+
84
+
Let's reset just the "people" resource list, leaving the todos unchanged. Include the [src/merge.js](./src/merge.js) middleware
0 commit comments