Kind: Constant
Source: packages/common/decorators/http/request-mapping.decorator.ts
Part of: Common
Route handler (method) Decorator. Routes Webdav MOVE requests to the specified path.
Move is a route handler decorator for WebDAV MOVE requests. Apply it to a controller method to map a destination path to logic that relocates a WebDAV resource, such as a file or collection.
Definition
tscreateMappingDecorator(RequestMethod.MOVE)
Value
tscreateMappingDecorator(RequestMethod.MOVE)
Diagram
mermaidgraph LR Client[WebDAV Client] -->|MOVE request| Router[HTTP Router] Router -->|matched path| MoveDecorator["@Move(path)"] MoveDecorator --> Handler[Controller Method] Handler --> Resource[Move Resource]
Usage
tsimport { Move } from '@your-package/common';
class FilesController {
@Move('/files/:path')
async moveFile() {
// Read WebDAV MOVE headers, such as Destination and Overwrite,
// then move the requested resource.
return { status: 201 };
}
}
AI Coding Instructions
- Use
@Move()only on controller methods intended to handle WebDAVMOVEoperations. - Define a path that matches the resource being moved; include route parameters when resource identifiers are needed.
- Read and validate WebDAV-specific headers such as
Destination,Overwrite, and authorization data in the handler or middleware. - Return appropriate WebDAV/HTTP status codes, including conflict or precondition failures when a move cannot be completed.
- Keep move logic in a service layer where possible; the decorated handler should focus on request mapping and response handling.
Was this page helpful?