Skip to content

Commit

Permalink
Create post route
Browse files Browse the repository at this point in the history
  • Loading branch information
amos-cha committed Jun 24, 2024
1 parent e913f74 commit 3839d8a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Gordon360/Controllers/PostersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ public ActionResult<IEnumerable<PosterViewModel>> GetPosterStatuses()
throw new NotImplementedException();
}

/// <summary>
/// Creates a poster
/// </summary>
/// <param name="poster"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
[Route("")]
public async Task<ActionResult<PosterViewModel>> CreatePoster(PosterUploadViewModel poster)
{
throw new NotImplementedException();
}

/// <summary>
/// Updates specified poster by ID
/// </summary>
Expand All @@ -87,7 +100,7 @@ public ActionResult<IEnumerable<PosterViewModel>> GetPosterStatuses()
/// <exception cref="NotImplementedException"></exception>
[HttpPatch]
[Route("{posterID}")]
public ActionResult<IEnumerable<PosterViewModel>> UpdatePoster(int posterID)
public async Task<ActionResult<PosterViewModel>> UpdatePoster(int posterID)
{
throw new NotImplementedException();
}
Expand All @@ -100,7 +113,7 @@ public ActionResult<IEnumerable<PosterViewModel>> UpdatePoster(int posterID)
/// <exception cref="NotImplementedException"></exception>
[HttpDelete]
[Route("{posterID}")]
public ActionResult<IEnumerable<PosterViewModel>> DeletePoster(int posterID)
public async Task<ActionResult<PosterViewModel>> DeletePoster(int posterID)
{
throw new NotImplementedException();
}
Expand Down
17 changes: 17 additions & 0 deletions Gordon360/Models/ViewModels/PosterUploadViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Gordon360.Models.CCT;
using System;

namespace Gordon360.Models.ViewModels;

public class PosterUploadViewModel

{
public string ClubCode { get; set; }
public string Title { get; set; }
public string? Description { get; set; }
public string ImagePath { get; set; }
public DateTime VisibleDate { get; set; }
public DateTime ExpirationDate { get; set; }
public string Status { get; set; }

}

0 comments on commit 3839d8a

Please sign in to comment.