Test blog controller

This commit is contained in:
Robert Marshall 2020-04-13 13:01:14 +01:00
parent df01f4aa1d
commit fcdec66861
2 changed files with 180 additions and 4 deletions

View file

@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@ -31,7 +30,7 @@ namespace Website.Controllers {
var model = new BlogPostViewModel(post, preview);
return View(model);
} catch (InvalidOperationException) {
} catch (ApiCallException) {
return NotFound();
}
}
@ -49,7 +48,7 @@ namespace Website.Controllers {
Content = post.Draft
};
return View(model);
} catch (InvalidOperationException) {
} catch (ApiCallException) {
return NotFound();
}
}