Skip to content

Commit

Permalink
resources: in account access use appropriate types.
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed Dec 15, 2023
1 parent 2fc5de4 commit b25a837
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/lib/api/resources/AccountAccesses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { AxiosInstance } from "axios";

import CONFIG from "../../../config";

import { Attachment } from "../../../types/api/attachments";
import { AccountAccessFilters } from "../../../types/api/account-accesses";
import {
AccountAccessFilters,
DeleteAccountAccessResponse,
} from "../../../types/api/account-accesses";
import { Resource } from "../../../types/api/permissions";

const { CLIENT_SETTINGS } = CONFIG;
const { GENERAL_ENDPOINT } = CLIENT_SETTINGS;
Expand Down Expand Up @@ -39,7 +42,7 @@ export default class AccountsAccessesApi {
}
: {};

return this.client.get<Attachment[], Attachment[]>(url, { params });
return this.client.get<Resource[], Resource[]>(url, { params });
}

/**
Expand All @@ -50,6 +53,9 @@ export default class AccountsAccessesApi {
public async removeAccountAccess(accountAccessId: number) {
const url = `${this.accountAccessesURL}/${accountAccessId}`;

return this.client.get<Attachment, Attachment>(url);
return this.client.delete<
DeleteAccountAccessResponse,
DeleteAccountAccessResponse
>(url);
}
}

0 comments on commit b25a837

Please sign in to comment.