# Move

**Kind:** Constant

**Source:** [`packages/common/decorators/http/request-mapping.decorator.ts`](https://github.com/nestjs/nest/blob/master/packages/common/decorators/http/request-mapping.decorator.ts#L165)

**Part of:** [Common](subsystem-packages-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

```ts
createMappingDecorator(RequestMethod.MOVE)
```

## Value

```ts
createMappingDecorator(RequestMethod.MOVE)
```

## Diagram

```mermaid
graph LR
  Client[WebDAV Client] -->|MOVE request| Router[HTTP Router]
  Router -->|matched path| MoveDecorator["@Move(path)"]
  MoveDecorator --> Handler[Controller Method]
  Handler --> Resource[Move Resource]
```

## Usage

```ts
import { 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 WebDAV `MOVE` operations.
- 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.
