This commit is contained in:
@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers.V2
|
||||
@ -20,8 +21,8 @@ namespace HanyadikHetVan.Controllers.V2
|
||||
_funfactService = funfactService ?? throw new ArgumentNullException(nameof(funfactService));
|
||||
}
|
||||
|
||||
[HttpPut("{weeklytimespanId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(FunFactDTO))]
|
||||
[HttpGet("WeeklyTimeSpan/{weeklytimespanId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(List<FunFactDTO>))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetFunFactOfWeeklyTimeSpan(int weeklytimespanId)
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
using HanyadikHetVan.DTO;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@ -41,7 +42,7 @@ namespace HanyadikHetVan.Controllers.V2
|
||||
}
|
||||
}
|
||||
[HttpDelete("{pauseId}")]
|
||||
[Authorize(Roles = "admin")]
|
||||
[Authorize(Policy = "AdminPolicy", AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
@ -58,7 +59,7 @@ namespace HanyadikHetVan.Controllers.V2
|
||||
}
|
||||
}
|
||||
[HttpPut]
|
||||
[Authorize(Roles = "admin")]
|
||||
[Authorize(Policy = "AdminPolicy", AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(PauseDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
|
@ -1,6 +1,7 @@
|
||||
using HanyadikHetVan.Data.Entities;
|
||||
using HanyadikHetVan.DTO;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
@ -46,7 +47,7 @@ namespace HanyadikHetVan.Controllers.V2
|
||||
}
|
||||
}
|
||||
[HttpDelete("{weeklyTimeSpanId}")]
|
||||
[Authorize(Roles = "admin")]
|
||||
[Authorize(Policy = "AdminPolicy", AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
@ -63,7 +64,7 @@ namespace HanyadikHetVan.Controllers.V2
|
||||
}
|
||||
}
|
||||
[HttpPut]
|
||||
[Authorize(Roles = "admin")]
|
||||
[Authorize(Policy = "AdminPolicy", AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
|
Reference in New Issue
Block a user