fixed bug where you couldn't edit a quote

This commit is contained in:
tmont 2011-03-05 22:24:50 +00:00
parent b04f474605
commit 301a89f685
3 changed files with 6 additions and 4 deletions

View File

@ -192,7 +192,7 @@ namespace VideoGameQuotes.Web.Controllers {
} }
[HttpPost, VerifyUser(Group = UserGroup.Admin)] [HttpPost, VerifyUser(Group = UserGroup.Admin)]
public ActionResult Edit(EditQuoteModelBase model) { public ActionResult Edit(EditQuoteModel model) {
return CreateOrEditQuote(model, "Edit"); return CreateOrEditQuote(model, "Edit");
} }

View File

@ -76,11 +76,11 @@ namespace VideoGameQuotes.Web {
//these routes don't work with constraints in mono...? //these routes don't work with constraints in mono...?
routes.MapSmartRoute("quote-edit", "quote/edit/{id}", new { controller = "Quote", action = "Edit" }); routes.MapSmartRoute("quote-edit", "quote/edit/{id}", new { controller = "Quote", action = "Edit" });
routes.MapSmartRoute("quote-delete", "quote/delete", new { controller = "Quote", action = "Delete" });
routes.MapSmartRoute("quote-dismiss-flag", "quote/dismiss-flag", new { controller = "Quote", action = "DismissFlag" });
routes.MapSmartRoute("single-quote", "quote/{id}/{*text}", new { controller = "Quote", action = "Quote" }); routes.MapSmartRoute("single-quote", "quote/{id}/{*text}", new { controller = "Quote", action = "Quote" });
//routes.MapSmartRoute("dismiss-flag", "dismiss-flag", new { controller = "Quote", action = "FooBar" }); routes.MapSmartRoute("quote-delete", "quote/delete", new { controller = "Quote", action = "Delete" });
routes.MapSmartRoute("quote-dismiss-flag", "quote/dismiss-flag", new { controller = "Quote", action = "DismissFlag" });
routes.MapSmartRoute("default", "", new { controller = "Home", action = "Index" }); routes.MapSmartRoute("default", "", new { controller = "Home", action = "Index" });
} }
} }

View File

@ -4,6 +4,8 @@ using VideoGameQuotes.Api;
namespace VideoGameQuotes.Web.Models { namespace VideoGameQuotes.Web.Models {
public class EditQuoteModel : EditQuoteModelBase { public class EditQuoteModel : EditQuoteModelBase {
public EditQuoteModel() { }
public EditQuoteModel(Quote quote) { public EditQuoteModel(Quote quote) {
QuoteId = quote.Id; QuoteId = quote.Id;
Flags = quote.Flags.ToList(); Flags = quote.Flags.ToList();