links: fix direct loading of link entry

If you go directly to a link's page, it will never load, because we
don't look for 'link-update' in our data, post-global store. This checks
properly.
This commit is contained in:
Matilde Park 2020-08-05 12:27:48 -04:00
parent ef62796305
commit f1fd99a898

View File

@ -44,8 +44,8 @@ export default class LinksApi extends BaseApi<StoreState> {
this.fetchLink(
endpoint,
(res) => {
if (res.data.submission) {
callback(res.data.submission);
if (res.data?.['link-update']?.submission) {
callback(res.data?.['link-update']?.submission);
} else {
console.error('unexpected submission response', res);
}