Skip to content

Commit

Permalink
chore: add missing actions to identity (#1065)
Browse files Browse the repository at this point in the history
  • Loading branch information
eren-ayasofyazilim authored Dec 25, 2024
2 parents 127eec2 + 30b4f16 commit 56acdff
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 62 deletions.
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"@auth/core": "^0.30.0",
"@ayasofyazilim/saas": "0.0.90",
"@ayasofyazilim/saas": "0.0.95",
"@formatjs/intl-localematcher": "^0.5.4",
"@radix-ui/react-icons": "^1.3.0",
"@repo/ayasofyazilim-ui": "workspace:^",
Expand Down
23 changes: 0 additions & 23 deletions apps/web/src/actions/api-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ import type {
PostApiExportValidationServiceExportValidationData,
PutApiExportValidationServiceExportValidationByIdData,
} from "@ayasofyazilim/saas/ExportValidationService";
import type {
GetApiFinanceServiceBillingsData,
PostApiFinanceServiceBillingsData,
PutApiFinanceServiceBillingsByIdData,
} from "@ayasofyazilim/saas/FinanceService";
import type {
GetApiIdentityClaimTypesData,
GetApiIdentityRolesByIdClaimsData,
Expand Down Expand Up @@ -116,7 +111,6 @@ import {
getContractServiceClient,
getCRMServiceClient,
getExportValidationServiceClient,
getFinanceServiceClient,
getIdentityServiceClient,
getLocationServiceClient,
getRefundServiceClient,
Expand Down Expand Up @@ -180,7 +174,6 @@ export async function getApiRequests() {
const exportValidationClient =
await getExportValidationServiceClient(session);
const tagClient = await getTagServiceClient(session);
const financeClient = await getFinanceServiceClient(session);
const refundClient = await getRefundServiceClient(session);
const administrationClient = await getAdministrationServiceClient(session);
const tableRequests = {
Expand Down Expand Up @@ -896,22 +889,6 @@ export async function getApiRequests() {
get: async (data: GetApiTagServiceTagData) =>
await tagClient.tag.getApiTagServiceTag(data),
},
billing: {
get: async (data: GetApiFinanceServiceBillingsData) =>
await financeClient.billing.getApiFinanceServiceBillings(data),
getDetail: async (id: string) =>
await financeClient.billing.getApiFinanceServiceBillingsById({
id,
}),
post: async (data: PostApiFinanceServiceBillingsData) =>
await financeClient.billing.postApiFinanceServiceBillings(data),
put: async (data: PutApiFinanceServiceBillingsByIdData) =>
await financeClient.billing.putApiFinanceServiceBillingsById(data),
deleteRow: async (id: string) =>
await financeClient.billing.deleteApiFinanceServiceBillings({
id,
}),
},
applications: {
getTokenLifetime: async (
data: GetApiOpeniddictApplicationsByIdTokenLifetimeData,
Expand Down
16 changes: 13 additions & 3 deletions apps/web/src/actions/core/IdentityService/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,25 @@ export async function deleteUserSessionsApi(id: string) {
}
}

export async function getAssignableRolesApi(id: string) {
export async function getAssignableRolesApi(roleId: string) {
try {
const client = await getIdentityServiceClient();
const dataResponse =
await client.assignableRole.getApiIdentityAssignableRolesAllRolesWithAssignableById(
{ id },
await client.assignableRole.getApiIdentityAssignableRolesAllRolesWithAssignableByRoleId(
{ roleId },
);
return structuredResponse(dataResponse);
} catch (error) {
return structuredError(error);
}
}
export async function getAssignableRolesByCurrentUserApi() {
try {
const client = await getIdentityServiceClient();
const dataResponse =
await client.role.getApiIdentityRolesAssignableRolesByCurrentUser();
return structuredResponse(dataResponse);
} catch (error) {
return structuredError(error);
}
}
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type-check": "tsc --noEmit"
},
"peerDependencies": {
"@ayasofyazilim/saas": "0.0.87",
"@ayasofyazilim/saas": "0.0.95",
"@repo/ayasofyazilim-ui": "workspace:*",
"next": "14.1.1",
"react": "18.3.0",
Expand Down
Loading

0 comments on commit 56acdff

Please sign in to comment.