Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST /versions #262

Closed
mfito opened this issue May 23, 2024 · 2 comments
Closed

POST /versions #262

mfito opened this issue May 23, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mfito
Copy link

mfito commented May 23, 2024

Is your feature request related to a problem? Please describe.

I want to POST a version of an existing collection item via API

Describe the solution you'd like

in directus SDK there is a function "createContentVersion" width params to create a version. It returns itself

createContentVersion({ key: 'my_version', name: 'My Version', collection: 'my_collection', item: 1, })

@mfito mfito added the enhancement New feature or request label May 23, 2024
@sandros94
Copy link
Collaborator

Currently the module doesn't support it out of the box.

But if you are using nuxt-directus-next you could use the built-in Rest client and any sdk function, like so:

import { createContentVersion } from '@directus/sdk'

const client = useDirectusRest()

async function newContentVersion(item) {
  await client.request(createContentVersion({
    key: 'my_version',
    name: 'My Version',
    collection: 'my_collection',
    item
  }))
}

ps: I still haven't used versions, so refer to the official Directus Docs

@casualmatt
Copy link
Collaborator

--> #271

nuxt-directus-next is EOL

@casualmatt casualmatt closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants