Skip to content

Commit e5bf56b

Browse files
committed
fix(pinia-colada): optional options in mutation factory
1 parent 8b8c368 commit e5bf56b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

packages/openapi-ts/src/plugins/@pinia/colada/mutationOptions.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import type ts from 'typescript';
33
import type { GeneratedFile } from '../../../generate/file';
44
import type { IR } from '../../../ir/types';
55
import { tsc } from '../../../tsc';
6-
import {
7-
createOperationComment,
8-
isOperationOptionsRequired,
9-
} from '../../shared/utils/operation';
6+
import { createOperationComment } from '../../shared/utils/operation';
107
import { handleMeta } from './meta';
118
import type { PluginState } from './state';
129
import type { PiniaColadaPlugin } from './types';
@@ -129,11 +126,6 @@ export const createMutationOptions = ({
129126
});
130127
}
131128

132-
const isRequiredOptionsForMutation = isOperationOptionsRequired({
133-
context: plugin.context,
134-
operation,
135-
});
136-
137129
const statement = tsc.constVariable({
138130
comment: plugin.config.comments
139131
? createOperationComment({ operation })
@@ -142,9 +134,9 @@ export const createMutationOptions = ({
142134
expression: tsc.arrowFunction({
143135
parameters: [
144136
{
145-
isRequired: isRequiredOptionsForMutation,
137+
isRequired: false,
146138
name: 'options',
147-
type: typeData,
139+
type: `Partial<${typeData}>`,
148140
},
149141
],
150142
// TODO: better types syntax

0 commit comments

Comments
 (0)