Skip to content

Commit

Permalink
Merge branch 'main' into fix-faker-image-url
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle authored Sep 20, 2024
2 parents 5478d83 + 79205f9 commit 90ee06c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/vue-query/src/gen/hooks/useGetOrderById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function getOrderById(orderId: GetOrderByIdPathParams['orderId'], config:
return res.data
}

export function getOrderByIdQueryOptions(orderId: GetOrderByIdPathParams['orderId'], config: Partial<RequestConfig> = {}) {
export function getOrderByIdQueryOptions(orderId: MaybeRef<GetOrderByIdPathParams['orderId']>, config: Partial<RequestConfig> = {}) {
const queryKey = getOrderByIdQueryKey(orderId)
return queryOptions({
queryKey,
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-query/src/gen/hooks/useGetPetById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function getPetById(petId: GetPetByIdPathParams['petId'], config: Partial<
return res.data
}

export function getPetByIdQueryOptions(petId: GetPetByIdPathParams['petId'], config: Partial<RequestConfig> = {}) {
export function getPetByIdQueryOptions(petId: MaybeRef<GetPetByIdPathParams['petId']>, config: Partial<RequestConfig> = {}) {
const queryKey = getPetByIdQueryKey(petId)
return queryOptions({
queryKey,
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-query/src/gen/hooks/useGetUserByName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function getUserByName(username: GetUserByNamePathParams['username'], conf
return res.data
}

export function getUserByNameQueryOptions(username: GetUserByNamePathParams['username'], config: Partial<RequestConfig> = {}) {
export function getUserByNameQueryOptions(username: MaybeRef<GetUserByNamePathParams['username']>, config: Partial<RequestConfig> = {}) {
const queryKey = getUserByNameQueryKey(username)
return queryOptions({
queryKey,
Expand Down
10 changes: 9 additions & 1 deletion packages/plugin-vue-query/src/components/QueryOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ function getParams({ pathParamsType, typeSchemas }: GetParamsProps) {
return FunctionParams.factory({
pathParams: {
mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',
children: getPathParams(typeSchemas.pathParams, { typed: true }),
children: getPathParams(typeSchemas.pathParams, {
typed: true,
override(item) {
return {
...item,
type: `MaybeRef<${item.type}>`,
}
},
}),
},
data: typeSchemas.request?.name
? {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import client from "axios";
import type { UseMutationOptions } from "@tanstack/react-query";
import type { RequestConfig } from "axios";
import type { MaybeRef } from "vue";
import { useMutation } from "@tanstack/react-query";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import client from "@kubb/plugin-client/client";
import type { RequestConfig } from "@kubb/plugin-client/client";
import type { UseMutationOptions } from "@tanstack/react-query";
import type { MaybeRef } from "vue";
import { useMutation } from "@tanstack/react-query";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import client from "@kubb/plugin-client/client";
import type { RequestConfig } from "@kubb/plugin-client/client";
import type { UseMutationOptions } from "@tanstack/react-query";
import type { MaybeRef } from "vue";
import { useMutation } from "@tanstack/react-query";

/**
Expand Down

0 comments on commit 90ee06c

Please sign in to comment.