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: graph/patterns/viewpoint.md
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ This pattern simplifies the API client logic by hiding the state transition deta
24
24
</Annotations>
25
25
```
26
26
- An alternative to this design would be to store the user state on the client side. However, this may be problematic in some cases, because of the many devices that a user may have and the need to synchronize the state across them.
27
+
- Often, updating the `viewpoint` property may cause a side effect, so you might consider an OData action to do the update. For some user scenarios, the `PATCH` method could be a better way to update a `viewpoint`.
// User hasnt read anything since no message was posted
84
87
}
85
88
}
86
89
]
87
90
}
88
91
```
89
-
### Updating a viewpoint
92
+
### Updating a viewpoint using an action
90
93
91
-
You can update the `viewpoint` property only if the server does not compute it automatically. Updating the `viewpoint` property usually has a side effect, so you may want to use an OData action to perform the update.
92
-
93
-
The following example shows marking a chat as read for a user:
94
+
The following example shows marking a chat `viewpoint` as read for a user using an action:
94
95
95
96
```http
96
97
@@ -105,8 +106,31 @@ Content-length: 106
105
106
}
106
107
}
107
108
```
109
+
108
110
The server responds with a success status code and no payload:
109
111
110
112
```http
111
113
HTTP/1.1 204 No Content
112
114
```
115
+
### Updating a viewpoint using `PATCH` method
116
+
117
+
The following example shows how to mark a topic with the `viewpoint` label as reviewed for a user by using the `PATCH` method (this example does not represent an actual API, but only an illustration):
0 commit comments