Skip to content

Commit ddcf47a

Browse files
author
Asylgareev Rustam
committed
Add Unauthorized object result
1 parent 16cf475 commit ddcf47a

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/SmartHead.Essentials.Application/Controller/ApiControllerBase.cs renamed to src/SmartHead.Essentials.Application/Controller/FormattedApiControllerBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ public OkObjectResult Ok(object content, string debugData = null)
2727
[NonAction]
2828
public CreatedAtRouteResult CreatedAt(object routeValues, object content, string debugData = null)
2929
=> new CreatedAtRouteResult(routeValues, new SuccessApiResponse(content, debugData));
30+
[NonAction]
31+
public UnauthorizedObjectResult Unauthorized(string error = null)
32+
=> new UnauthorizedObjectResult(new ErrorApiResponse("Unauthorized", error));
3033
}
3134
}

src/SmartHead.Essentials.Application/SmartHead.Essentials.Application.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<IsPackable>true</IsPackable>
88
<Authors>Rustam Asylgareev</Authors>
99
<PackageProjectUrl>https://github.com/smarthead-dev/SmartHead.Essentials</PackageProjectUrl>
10-
<Version>0.0.6</Version>
10+
<Version>0.0.7</Version>
1111
<Company>SmartHead</Company>
1212
<IsTestProject>false</IsTestProject>
1313
<Description>SmartHead.Essentials.Application</Description>

0 commit comments

Comments
 (0)