Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

828 streamline network call for toggle defence #884

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

pmarsh-scottlogic
Copy link
Contributor

@pmarsh-scottlogic pmarsh-scottlogic commented Mar 28, 2024

Description

Previously we would activate/deactivate in the backend. If that was sucessful, then the frontend would send a further request to add an info message to the history. Now the backend generates this info message and forwards it to the frontend.

Concerns

  • There's no plan for if the request fails. Not necessarily in scope of ticket? i.e. don't want to deal with it right now

Checklist

Have you done the following?

  • Linked the relevant Issue
  • Added tests
  • Ensured the workflow steps are passing

const { chatInfoMessage } =
(await response.json()) as ChatInfoMessageResponse;

return makeChatMessageFromDTO(chatInfoMessage);
Copy link
Member

@chriswilty chriswilty Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lovely thing about returning a ChatMessage from all these service functions is that it'd be really easy to return an "error" chat message to go into the chat panel, instead of null to be ignored. If only we had time....

Copy link
Member

@chriswilty chriswilty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet 🍯

@pmarsh-scottlogic pmarsh-scottlogic merged commit 17ec740 into dev Mar 28, 2024
4 checks passed
@pmarsh-scottlogic pmarsh-scottlogic deleted the 828-streamline-network-call-for-toggle-defence branch March 28, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop adding messages to backend history via frontend 🛠🛠
2 participants