HUGE arch changes to make searching work right
This commit is contained in:
@ -82,23 +82,6 @@ namespace YTManager.Controllers.Private
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPost("{channelid}")]
|
||||
public async Task<IActionResult> PostChannel([FromRoute] string channelid) {
|
||||
// Only add it to the databse if it's not in there already.
|
||||
if (db.Channels.Any(c => c.YoutubeID == channelid))
|
||||
return BadRequest();
|
||||
|
||||
// Get the channel contents from youtube.
|
||||
var channel = await Tasks.FetchVideos.Get_YTChannel(channelid);
|
||||
|
||||
// Add it to the databse.
|
||||
await db.Channels.AddAsync(channel);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
// Say all went ok.
|
||||
return Ok(channel);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> PostChannel([FromBody] Channel channel)
|
||||
{
|
||||
|
Reference in New Issue
Block a user