Skip to content

Commit

Permalink
fix(admin_ui): type mismatch in apsara datatable (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbh authored Jun 13, 2024
1 parent e2b16d2 commit 0a7278e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Avatar, Flex, Text } from "@raystack/apsara";
import { ColumnDef } from "@tanstack/react-table";
import { ApsaraColumnDef, Avatar, Flex, Text } from "@raystack/apsara";
import Skeleton from "react-loading-skeleton";
import { V1Beta1BillingTransaction } from "@raystack/frontier";
import * as R from "ramda";
Expand All @@ -17,7 +16,7 @@ const TxnEventSourceMap = {

export const getColumns: (
options: getColumnsOptions
) => ColumnDef<V1Beta1BillingTransaction, any>[] = ({ isLoading }) => [
) => ApsaraColumnDef<V1Beta1BillingTransaction>[] = ({ isLoading }) => [
{
header: "Date",
accessorKey: "created_at",
Expand Down
13 changes: 5 additions & 8 deletions ui/src/containers/organisations.list/serviceusers/columns.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import { CheckCircledIcon } from "@radix-ui/react-icons";
import { ApsaraColumnDef } from "@raystack/apsara";
import { V1Beta1ServiceUser, V1Beta1User } from "@raystack/frontier";
import type { ColumnDef } from "@tanstack/react-table";
import { createColumnHelper } from "@tanstack/react-table";
import { Link } from "react-router-dom";

const columnHelper = createColumnHelper<V1Beta1User>();

interface getColumnsOptions {
orgId: string;
platformUsers: V1Beta1ServiceUser[];
}
export const getColumns: (
opt: getColumnsOptions
) => ColumnDef<V1Beta1User, any>[] = ({ orgId, platformUsers }) => {
) => ApsaraColumnDef<V1Beta1User>[] = ({ orgId, platformUsers }) => {
const platformUsersIdSet = new Set(platformUsers?.map((user) => user?.id));
return [
columnHelper.accessor("id", {
{
id: "id",
header: "ID",
//@ts-ignore
filterVariant: "text",
cell: ({ row, getValue }) => {
const serviceUserId = getValue();
Expand All @@ -27,7 +24,7 @@ export const getColumns: (
</Link>
);
},
}),
},
{
header: "Title",
accessorKey: "title",
Expand Down

0 comments on commit 0a7278e

Please sign in to comment.