asd
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-05-17 22:53:27 +02:00
parent bd788697c7
commit 4b993aa4e8
6 changed files with 58 additions and 34 deletions

View File

@ -4,8 +4,6 @@ using HanyadikHetVan.Services;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace HanyadikHetVan.Controllers
@ -37,7 +35,7 @@ namespace HanyadikHetVan.Controllers
return false;
}
}
[HttpDelete]
[HttpDelete("{weeklyTimeSpanId}")]
public bool DeleteWeeklyTimeSpan(int weeklyTimeSpanId)
{
try
@ -51,11 +49,11 @@ namespace HanyadikHetVan.Controllers
}
}
[HttpPut]
public bool UpdateWeeklyTimeSpan(WeeklyTimeSpan Object)
public bool UpdateWeeklyTimeSpan([FromBody] WeeklyTimeSpan weeklytimespan)
{
try
{
_weeklytimespanService.UpdateWeeklyTimeSpan(Object);
_weeklytimespanService.UpdateWeeklyTimeSpan(weeklytimespan);
return true;
}
catch (Exception)
@ -63,14 +61,14 @@ namespace HanyadikHetVan.Controllers
return false;
}
}
[HttpGet]
public Object GetAllWeeklyTimeSpanByStartdate(DateTime UserEmail)
[HttpGet("{startTime}")]
public Object GetAllWeeklyTimeSpanByStartdate(DateTime startTime)
{
var data = _weeklytimespanService.GetPersonByUserName(UserEmail);
var data = _weeklytimespanService.GetWeeklyTimeSpanByStartdate(startTime);
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
new JsonSerializerSettings()
{
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
}
);
return json;
@ -82,7 +80,19 @@ namespace HanyadikHetVan.Controllers
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
new JsonSerializerSettings()
{
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
}
);
return json;
}
[HttpGet("{weeklytimespanId}")]
public Object GetAllPausesOfTimeSpan(int weeklytimespanId)
{
var data = _weeklytimespanService.GetPausesOfWeeklyTimeSpan(weeklytimespanId);
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
new JsonSerializerSettings()
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
}
);
return json;