@outseta/react 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ import type {
15
15
 
16
16
  import type {
17
17
  Article,
18
+ ArticleAddArticleBody,
18
19
  ArticleGetAllArticlesParams,
19
20
  Case,
20
21
  CaseAddCaseBody,
@@ -460,6 +461,70 @@ export function useArticleGetAllArticles<TData = Awaited<ReturnType<typeof artic
460
461
 
461
462
 
462
463
  /**
464
+ * @summary Create a knowledge base article.
465
+ */
466
+ export const articleAddArticle = (
467
+ articleAddArticleBody: NonReadonly<ArticleAddArticleBody>,
468
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
469
+ ) => {
470
+
471
+
472
+ return customFetch<Article>(
473
+ {url: `/api/v1/support/articles`, method: 'POST',
474
+ headers: {'Content-Type': 'application/json', },
475
+ data: articleAddArticleBody, signal
476
+ },
477
+ options);
478
+ }
479
+
480
+
481
+
482
+ export const getArticleAddArticleMutationOptions = <TError = void,
483
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleAddArticle>>, TError,{data: NonReadonly<ArticleAddArticleBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
484
+ ): UseMutationOptions<Awaited<ReturnType<typeof articleAddArticle>>, TError,{data: NonReadonly<ArticleAddArticleBody>}, TContext> => {
485
+
486
+ const mutationKey = ['articleAddArticle'];
487
+ const {mutation: mutationOptions, request: requestOptions} = options ?
488
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
489
+ options
490
+ : {...options, mutation: {...options.mutation, mutationKey}}
491
+ : {mutation: { mutationKey, }, request: undefined};
492
+
493
+
494
+
495
+
496
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof articleAddArticle>>, {data: NonReadonly<ArticleAddArticleBody>}> = (props) => {
497
+ const {data} = props ?? {};
498
+
499
+ return articleAddArticle(data,requestOptions)
500
+ }
501
+
502
+
503
+
504
+
505
+ return { mutationFn, ...mutationOptions }}
506
+
507
+ export type ArticleAddArticleMutationResult = NonNullable<Awaited<ReturnType<typeof articleAddArticle>>>
508
+ export type ArticleAddArticleMutationBody = NonReadonly<ArticleAddArticleBody>
509
+ export type ArticleAddArticleMutationError = void
510
+
511
+ /**
512
+ * @summary Create a knowledge base article.
513
+ */
514
+ export const useArticleAddArticle = <TError = void,
515
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof articleAddArticle>>, TError,{data: NonReadonly<ArticleAddArticleBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
516
+ ): UseMutationResult<
517
+ Awaited<ReturnType<typeof articleAddArticle>>,
518
+ TError,
519
+ {data: NonReadonly<ArticleAddArticleBody>},
520
+ TContext
521
+ > => {
522
+
523
+ const mutationOptions = getArticleAddArticleMutationOptions(options);
524
+
525
+ return useMutation(mutationOptions);
526
+ }
527
+ /**
463
528
  * @summary Retrieve a knowledge base article.
464
529
  */
465
530
  export const articleGetArticle = (