Deleting a Message
The final method in this Worker is for deleting messages, the deleteMessage() method:
public async deleteMessage(inID: string, inMailbox: String):
Promise {
await axios.delete(
`${config.serverAddress}/messages/${inMailbox}/${inID}`
);
}
By this point, I’m betting you’re pretty comfortable with these Worker methods and
how they interact with the server. There’s nothing that says I had to mimic the basic
layout of the server code on the client. I could have had a drastically different structure to
these methods here. So long as they eventually call the server as expected, that’s all that
matters. But hopefully, you’ll agree that mirroring them like this helps keep it all straight
in your mind.
Chapter 9 Delivering the gooDs: MailBag, the Client
247
Do'stlaringiz bilan baham: |