On Tue, 21 Jul 2015 at 20:57:33, Marcel Korpel wrote:
* Lukas Fleischer <lfleischer@archlinux.org> (Tue, 21 Jul 2015 18:25:18 +0200):
We can directly return here when adding early returns for the error cases. I wonder whether it is a good idea to provide different data types, depending on whether an error occurred or not.
I don't think so, but at least this isn't a public API.
Would it make sense to use json_results() and json_error() here?
In all cases, you mean, error or not?
Yeah, in all cases.
Could be, but suggest() and suggest_pkgbase() also don't make use of them and they aren't public APIs either, but directly used by AJAX requests on the site.
Agreed. I had the idea of potentially making it part of the public API but it probably isn't too useful -- especially since it provides a whole comment edit form instead of the plain comment only.