This commit is contained in:
17
backend/src/utils/monkey-response.ts
Normal file
17
backend/src/utils/monkey-response.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { MonkeyResponseType } from "@monkeytype/contracts/util/api";
|
||||
|
||||
export type MonkeyDataAware<T> = {
|
||||
data: T | null;
|
||||
};
|
||||
|
||||
export class MonkeyResponse<T = null>
|
||||
implements MonkeyResponseType, MonkeyDataAware<T>
|
||||
{
|
||||
public message: string;
|
||||
public data: T;
|
||||
|
||||
constructor(message: string, data: T) {
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user