fix: enabled strict null checks and made changes to deal with this compiler change. fix: modified endpoint factory methods to not need baseURL to be passed in. instead just return endpoint because the axios client with already have a default url set as part of constructing a new onspring client instance

This commit is contained in:
StevanFreeborn
2023-02-02 13:53:02 -06:00
parent 88bf080847
commit d453f19c97
8 changed files with 137 additions and 178 deletions
+3 -3
View File
@@ -23,16 +23,16 @@ export class ApiResponse<T> {
/**
* @property {T} data - The data of the response.
*/
public data: T;
public data: T | null;
/**
* @constructor - Creates a new instance of the ApiResponse class.
* @param {number} statusCode - The status code of the response.
* @param {string} message - The message of the response.
* @param {T} data - The data of the response.
* @param {T | null} data - The data of the response.
* @returns {ApiResponse<T>} - A new instance of the ApiResponse class.
*/
constructor(statusCode: number, message: string, data: T) {
constructor(statusCode: number, message: string, data: T | null) {
this.statusCode = statusCode;
this.isSuccessful = statusCode < 400;
this.message = message;