diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-09 11:55:59 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-09 11:55:59 -0400 |
| commit | f624a6a49c7a924cbaae41b3f73ee3fa655c459e (patch) | |
| tree | 31b802183c44edb6ba8bd9c50bff8c36d7bf39f9 | |
| parent | fecc78192ff1ad83c6a2f41e35a65ac189d25c6f (diff) | |
Align send request fields with message fields by renaming `message` to `body`.
| -rw-r--r-- | docs/api.md | 2 | ||||
| -rw-r--r-- | hi-ui/src/apiServer.js | 4 | ||||
| -rw-r--r-- | src/channel/routes.rs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/docs/api.md b/docs/api.md index 7414ccf..4957666 100644 --- a/docs/api.md +++ b/docs/api.md @@ -139,7 +139,7 @@ Chat messages expire after 90 days and can no longer be retrieved at that time. ```json { - "message": "my amazing thoughts, by bob" + "body": "my amazing thoughts, by bob" } ``` diff --git a/hi-ui/src/apiServer.js b/hi-ui/src/apiServer.js index 3aa3f1b..57f1d8c 100644 --- a/hi-ui/src/apiServer.js +++ b/hi-ui/src/apiServer.js @@ -25,8 +25,8 @@ export async function createChannel(name) { return apiServer.post('/channels', { name }); } -export async function postToChannel(channelId, message) { - return apiServer.post(`/channels/${channelId}`, { message }); +export async function postToChannel(channelId, body) { + return apiServer.post(`/channels/${channelId}`, { body }); } export async function deleteMessage(messageId) { diff --git a/src/channel/routes.rs b/src/channel/routes.rs index 5d67af8..a92615f 100644 --- a/src/channel/routes.rs +++ b/src/channel/routes.rs @@ -56,7 +56,7 @@ impl IntoResponse for CreateError { #[derive(Clone, serde::Deserialize)] struct SendRequest { - message: String, + body: String, } async fn on_send( @@ -67,7 +67,7 @@ async fn on_send( Json(request): Json<SendRequest>, ) -> Result<StatusCode, SendErrorResponse> { app.messages() - .send(&channel, &login, &sent_at, &request.message) + .send(&channel, &login, &sent_at, &request.body) .await?; Ok(StatusCode::ACCEPTED) |
