Closed emillind closed 6 years ago
Trying to understand the function. I believe that this codes serves a list of messages based on IDs? And msg_dict["subject"] is already written in the messages, so we're just extending the dictionary with topic?
@emillind Is this the only place where messages are fetched from the backend? EDIT: Realised that this question might not be that easy to answer... But maybe this is a good first step. We'll see if stuff gets broken when we change the frontend
@Aweponken yes as I understand it you are correct, we're just extending the dictionary with topic which is set to the subject (which is already in there)
So it doesn't overwrite subject?
There is another endpoint for fetching a specific message but as far as i can see that is only done in the case of trying to edit a message and perhaps for notifications and quotations (you can find this by doing a project search for /messages/ and see which files) as well as different tests. However this version of getting messages only returns the content of the message and not stuff like subject etc.
However what the function i edited does is to
If you add a console.log(data.messages) in the success-function on line 98 in static/js/message_fetch.js you can see what it returns in action if you browse messages in your local dev server
@Aweponken @jockeboman @eywoon
I get this: commit_messages| Commit 9fa5f0b022: commit_messages| 1: Z2 Title does not match regex (^(.+:\ )?[A-Z].+.$): "Have GET /messages serve up topic in the response JSON"
When I run: ./tools/lint --backend
There seems to be a regex that does not want the "/" in the commit message @emillind
Fixed @jockeboman @Aweponken didnt realise you had to follow a regexp
When fetching messages from the backend those objects serve up topic as a copy of subject.
Part of #6