chore(core-flows,types,utils): fixes to TSDocs (#12692)

This commit is contained in:
Shahed Nasser
2025-06-10 18:33:41 +03:00
committed by GitHub
parent d8b196d6b1
commit 5ba842bfb0
4 changed files with 15 additions and 9 deletions

View File

@@ -40,9 +40,9 @@ const validateDraftOrdersStep = createStep(
export const deleteDraftOrderWorkflowId = "delete-draft-order"
/**
* This workflow deletes draft orders.
* This workflow deletes draft orders. It's used by the [Delete Draft Order API route](https://docs.medusajs.com/api/admin#draft-orders_deletedraftordersid).
*
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around canceling an order.
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around deleting a draft order.
*
* @example
* const { result } = await deleteDraftOrderWorkflow(container)
@@ -55,8 +55,6 @@ export const deleteDraftOrderWorkflowId = "delete-draft-order"
* @summary
*
* Delete draft orders.
*
* @property hooks.orderCanceled - This hook is executed after the order is canceled. You can consume this hook to perform custom actions on the canceled order.
*/
export const deleteDraftOrdersWorkflow = createWorkflow(
deleteDraftOrderWorkflowId,

View File

@@ -123,7 +123,7 @@ export interface IFileProvider {
/**
* This method is used to delete one or more files from the storage
*
* @param {ProviderDeleteFileDTO | ProviderDeleteFileDTO[]} fileData - The details of the file to remove.
* @param {ProviderDeleteFileDTO | ProviderDeleteFileDTO[]} fileData - The details of the files to remove.
* @returns {Promise<void>} Resolves when the file is deleted successfully.
*
*/

View File

@@ -128,18 +128,23 @@ export class AbstractFileProviderService implements IFileProvider {
* This method deletes one or more files from the storage. It's used when an admin user
* deletes a product image, or other custom file deletions.
*
* @param {FileTypes.ProviderDeleteFileDTO | FileTypes.ProviderDeleteFileDTO[]} files - The details of the file(s) to delete.
* @returns {Promise<void>} Resolves when the file is deleted.
* @param {FileTypes.ProviderDeleteFileDTO | FileTypes.ProviderDeleteFileDTO[]} files - The details of the files to delete.
* @returns {Promise<void>} Resolves when the files are deleted.
*
* @example
* class MyFileProviderService extends AbstractFileProviderService {
* // ...
* async delete(file: ProviderDeleteFileDTO): Promise<void> {
* async delete(
* files: FileTypes.ProviderDeleteFileDTO | FileTypes.ProviderDeleteFileDTO[]
* ): Promise<void> {
* // TODO logic to remove the file from storage
* // Use the `file.fileKey` to delete the file, which is the identifier of the file
* // in the provider's storage.
* // for example:
* this.client.delete(file.fileKey)
* const fileArray = Array.isArray(files) ? files : [files]
* for (const file of fileArray) {
* this.client.delete(file.fileKey)
* }
* }
* }
*/

View File

@@ -56,6 +56,9 @@ export const POST = async (
.json({ draft_order: result.data[0] as HttpTypes.AdminDraftOrder })
}
/**
* @version 2.8.4
*/
export const DELETE = async (
req: AuthenticatedMedusaRequest,
res: MedusaResponse