Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run codemod use-select-query-result for all examples #6193

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions examples/app-crm-minimal/src/routes/companies/edit/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ export const CompanyForm = () => {
});
const { avatarUrl, name } = queryResult?.data?.data || {};

const { selectProps: selectPropsUsers, queryResult: queryResultUsers } =
useSelect<GetFieldsFromList<UsersSelectQuery>>({
resource: "users",
optionLabel: "name",
pagination: {
mode: "off",
},
meta: {
gqlQuery: USERS_SELECT_QUERY,
},
});
const { selectProps: selectPropsUsers, query: queryResultUsers } = useSelect<
GetFieldsFromList<UsersSelectQuery>
>({
resource: "users",
optionLabel: "name",
pagination: {
mode: "off",
},
meta: {
gqlQuery: USERS_SELECT_QUERY,
},
});

return (
<Edit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const CompanyCreateModal = () => {
},
});

const { selectProps, queryResult } = useSelect<
const { selectProps, query: queryResult } = useSelect<
GetFieldsFromList<UsersSelectQuery>
>({
resource: "users",
Expand Down
2 changes: 1 addition & 1 deletion examples/app-crm/src/routes/scrumboard/sales/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const SalesCreatePage: FC<PropsWithChildren> = ({ children }) => {
}
}, [searchParams]);

const { selectProps, queryResult } = useSelect<
const { selectProps, query: queryResult } = useSelect<
GetFieldsFromList<SalesCompaniesSelectQuery>
>({
resource: "companies",
Expand Down
18 changes: 8 additions & 10 deletions examples/app-crm/src/routes/scrumboard/sales/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ export const SalesEditPage = () => {
},
});

const {
selectProps: companySelectProps,
queryResult: companySelectQueryResult,
} = useSelect<GetFieldsFromList<SalesCompaniesSelectQuery>>({
resource: "companies",
optionLabel: "name",
meta: {
gqlQuery: SALES_COMPANIES_SELECT_QUERY,
},
});
const { selectProps: companySelectProps, query: companySelectQueryResult } =
useSelect<GetFieldsFromList<SalesCompaniesSelectQuery>>({
resource: "companies",
optionLabel: "name",
meta: {
gqlQuery: SALES_COMPANIES_SELECT_QUERY,
},
});

const { selectProps: stageSelectProps } = useDealStagesSelect();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export const FixedSider: React.FC = () => {
>
<ThemedTitle collapsed={collapsed} />
</div>

<Menu
style={{
marginTop: "8px",
Expand Down
2 changes: 1 addition & 1 deletion examples/data-provider-sanity/src/pages/posts/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const PostList = () => {
},
});

const { selectProps: selectPropsCategory, queryResult: queryResultCategory } =
const { selectProps: selectPropsCategory, query: queryResultCategory } =
useSelect({
resource: "category",
optionLabel: "title",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const ProductListTable = () => {
},
});

const { selectProps: categorySelectProps, queryResult } =
const { selectProps: categorySelectProps, query: queryResult } =
useSelect<ICategory>({
resource: "categories",
optionLabel: "title",
Expand Down
4 changes: 2 additions & 2 deletions examples/finefoods-antd/src/pages/couriers/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ export const CourierList = ({ children }: PropsWithChildren) => {
<FilterDropdown {...props}>
<InputMask mask="(999) 999 99 99">
{/*
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore */}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore */}
{(props: InputProps) => <Input {...props} />}
</InputMask>
</FilterDropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const BasicDataGrid: React.FC = () => {

const {
options,
queryResult: { isLoading },
query: { isLoading },
} = useSelect<ICategory>({
resource: "categories",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const PostList: React.FC = () => {

const {
options,
queryResult: { isLoading },
query: { isLoading },
} = useSelect<ICategory>({
resource: "categories",
hasPagination: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const PostList: React.FC = () => {

const {
options,
queryResult: { isLoading },
query: { isLoading },
} = useSelect<ICategory>({
resource: "categories",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const PostList: React.FC = () => {

const {
options,
queryResult: { isLoading },
query: { isLoading },
} = useSelect<ICategory>({
resource: "categories",
hasPagination: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const PostList: React.FC = () => {

const {
options,
queryResult: { isLoading },
query: { isLoading },
} = useSelect<ICategory>({
resource: "categories",
});
Expand Down
Loading