Test blog controller
This commit is contained in:
parent
df01f4aa1d
commit
fcdec66861
2 changed files with 180 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue