mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
Move to libs
This commit is contained in:
13
libs/common/src/models/response/listResponse.ts
Normal file
13
libs/common/src/models/response/listResponse.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { BaseResponse } from "./baseResponse";
|
||||
|
||||
export class ListResponse<T> extends BaseResponse {
|
||||
data: T[];
|
||||
continuationToken: string;
|
||||
|
||||
constructor(response: any, t: new (dataResponse: any) => T) {
|
||||
super(response);
|
||||
const data = this.getResponseProperty("Data");
|
||||
this.data = data == null ? [] : data.map((dr: any) => new t(dr));
|
||||
this.continuationToken = this.getResponseProperty("ContinuationToken");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user