yale-user-access/packages/backend/Models/ApiResponse.cs
Liam Pietralla f577617b4d
All checks were successful
Build and Publish / Build Yale Access Backend (push) Successful in 28s
Build and Publish / Build Yale Access Frontend (push) Successful in 47s
Build and Publish / Push Yale Access Backend Docker Image (push) Successful in 9s
Build and Publish / Push Yale Access Frontend Docker Image (push) Successful in 10s
initial commit
2025-01-10 08:37:18 +11:00

30 lines
744 B
C#

namespace YaleAccess.Models
{
public class ApiResponse
{
public bool Success { get; set; }
public string? Error { get; set; }
public object? Data { get; set; }
/// <summary>
/// If passing in data only then the resonse is successful
/// </summary>
/// <param name="data"></param>
public ApiResponse(object data)
{
Success = true;
Data = data;
}
/// <summary>
/// If passing in an error then the response is not successful
/// </summary>
/// <param name="error"></param>
public ApiResponse(string error)
{
Success = false;
Error = error;
}
}
}