diff --git a/docs/pages/clduploadbutton/basic-usage.mdx b/docs/pages/clduploadbutton/basic-usage.mdx index c9e75d34..534c4c14 100644 --- a/docs/pages/clduploadbutton/basic-usage.mdx +++ b/docs/pages/clduploadbutton/basic-usage.mdx @@ -43,7 +43,7 @@ export const UnsignedUpload = () => { <> { + onSuccess={(result, { widget }) => { setResource(result?.info); widget.close(); }} diff --git a/docs/pages/clduploadbutton/examples.mdx b/docs/pages/clduploadbutton/examples.mdx index 73d3c718..ea59bf70 100644 --- a/docs/pages/clduploadbutton/examples.mdx +++ b/docs/pages/clduploadbutton/examples.mdx @@ -37,7 +37,7 @@ export const UnsignedUpload = () => {

{ + onSuccess={(result, { widget }) => { setResource(result?.info); widget.close(); }} @@ -71,7 +71,7 @@ export const SignedUpload = () => {

{ + onSuccess={(result, { widget }) => { setResource(result?.info); widget.close(); }} diff --git a/docs/pages/clduploadwidget/configuration.mdx b/docs/pages/clduploadwidget/configuration.mdx index 7788e16b..2a14a2ef 100644 --- a/docs/pages/clduploadwidget/configuration.mdx +++ b/docs/pages/clduploadwidget/configuration.mdx @@ -270,11 +270,6 @@ Server Actions workflow. example: () => ({`(results, options) => { }`}), more: () => (More Info) }, - { - prop: 'onUpload (Deprecated)', - type: 'function', - example: () => ({`(results, widget) => { }`}), - }, { prop: 'onUploadAdded', type: 'function', diff --git a/docs/pages/guides/uploading-images-and-videos.mdx b/docs/pages/guides/uploading-images-and-videos.mdx index fc60f6cb..bb6f6033 100644 --- a/docs/pages/guides/uploading-images-and-videos.mdx +++ b/docs/pages/guides/uploading-images-and-videos.mdx @@ -33,7 +33,7 @@ export const SignedUpload = () => { <> { + onSuccess={(result, { widget }) => { setResource(result?.info); widget.close(); }} @@ -64,7 +64,7 @@ const [resource, setResource] = useState(); { + onSuccess={(result, { widget }) => { setResource(result?.info); // { public_id, secure_url, etc } widget.close(); }} diff --git a/next-cloudinary/src/components/CldUploadButton/CldUploadButton.tsx b/next-cloudinary/src/components/CldUploadButton/CldUploadButton.tsx index 54d92990..9bcbab62 100644 --- a/next-cloudinary/src/components/CldUploadButton/CldUploadButton.tsx +++ b/next-cloudinary/src/components/CldUploadButton/CldUploadButton.tsx @@ -14,7 +14,6 @@ const CldUploadButton = ({ onClick, onError, onOpen, - onUpload, onAbort, onBatchCancelled, onClose, @@ -52,7 +51,6 @@ const CldUploadButton = ({ { - if ( typeof results === 'undefined' ) return; - - const isSuccess = results.event === 'success'; - - if ( isSuccess && typeof onUpload === 'function' ) { - if ( process.env.NODE_ENV === 'development' ) { - console.warn('The onUpload callback is deprecated. Please use onSuccess instead.'); - } - onUpload(results, widget.current); - } - }, [results]) - /** * handleOnLoad * @description Stores the Cloudinary window instance to a ref when the widget script loads diff --git a/next-cloudinary/src/components/CldUploadWidget/CldUploadWidget.types.ts b/next-cloudinary/src/components/CldUploadWidget/CldUploadWidget.types.ts index 2415776b..285270a0 100644 --- a/next-cloudinary/src/components/CldUploadWidget/CldUploadWidget.types.ts +++ b/next-cloudinary/src/components/CldUploadWidget/CldUploadWidget.types.ts @@ -15,10 +15,6 @@ export interface CldUploadWidgetProps { config?: ConfigOptions; onError?: CldUploadEventCallbackError; onOpen?: CldUploadEventCallbackWidgetOnly; - /** - * @deprecated use onSuccess instead - */ - onUpload?: CldUploadEventCallbackNoOptions; onAbort?: CldUploadEventCallback; onBatchCancelled?: CldUploadEventCallback; onClose?: CldUploadEventCallback; @@ -60,7 +56,6 @@ export type CldUploadWidgetPropsChildren = { export type CldUploadEventCallback = (results: CloudinaryUploadWidgetResults, widget: CldUploadEventCallbackWidget) => void; export type CldUploadEventAction = (results: CloudinaryUploadWidgetResults) => void; -export type CldUploadEventCallbackNoOptions = (results: CloudinaryUploadWidgetResults, widget: CldUploadWidgetWidgetInstance) => void; export type CldUploadEventCallbackWidgetOnly = (widget: CldUploadWidgetWidgetInstance) => void; export type CldUploadEventCallbackError = (error: CloudinaryUploadWidgetError, widget: CldUploadEventCallbackWidget) => void;