1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00
Files
browser/libs/common/src/models/response/listResponse.ts
2022-06-03 16:24:40 +02:00

14 lines
431 B
TypeScript

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");
}
}