Skip to content

Update Project

  Method: PUT

/api/ps/projects/{ID}

  Headers

  • 'Content-Type': 'application/json'

  Parameters

  • title - title project, required
  • description - short description, required
  • titleRu - title project, optional
  • descriptionRu - short description, optional
  • category - ANDROID, WEB, IOS, OTHER, required
  • publicImage - url image, required
  • url - url to website project, optional
  • urlGitHub - url to website project, optional
  • urlSnapcraft - url to website project, optional
  • urlDownload - url to website project, optional
  • urlYouTube - url to website project, optional
  • isPublished - is public on website, required
  • uploads - ids uploads for relations, required

Code samples

await fetch('/api/ps/projects/{ID}', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        category: 'OTHER',
        publicImage: 'https://keygenqt.com/images/blog/601076d399c15.jpg',
        title: 'Title',
        url: 'https://api.keygenqt.com/',
        urlGitHub: 'https://github.com/keygenqt',
        urlSnapcraft: 'https://snapcraft.io/',
        urlDownload: 'https://keygenqt.com/files/601076d399c15.zip',
        urlYouTube: 'https://www.youtube.com/',
        description: 'Description',
        isPublished: false,
        uploads: [1, 2, 3], // ids uploads for relations
    })
}).then(async (response) => {
    console.log(response)
})
  HTTP response status codes
Status code Description
200 OK
400 Bad Request
404 Resource not found
422 Form validate
500 Internal Error

  Status: 200

{
    "id": 1,
    "title": "Title",
    "description": "Description",
    "titleRu": "Title",
    "descriptionRu": "Description",
    "category": "OTHER",
    "publicImage": "https://keygenqt.com/images/blog/61337b11b1300.jpg",
    "url": "https://api.keygenqt.com/",
    "urlGitHub": "https://github.com/keygenqt",
    "urlSnapcraft": 'https://snapcraft.io/',
    "urlDownload": 'https://keygenqt.com/files/601076d399c15.zip',
    "urlYouTube": 'https://www.youtube.com/',
    "isPublished": false,
    "createAt": 1661533680528,
    "updateAt": 1661533680528,
    "uploads": [
        {
            "id": 1,
            "fileName": "d523f3fb-a8fe-49d9-9e67-3ce8b3231037.png",
            "fileMime": "image/png",
            "originalFileName": "screenshot-17.png",
            "createAt": 1661592987307
        }
    ]
}

  Status: 400

{
    "code": 400,
    "message": "Bad Request"
}

  Status: 404

{
    "code": 404,
    "message": "Resource not found"
}

  Status: 422

{
    "code": 422,
    "message": "Error update project, please check the correctness of data entry",
    "validate": [
        {
            "filed": "description",
            "errors": [
                "Size must be between 3 and 500",
                "Must not be null and not blank"
            ]
        },
        {
            "filed": "title",
            "errors": [
                "Size must be between 3 and 255",
                "Must not be null and not blank"
            ]
        }
    ]
}

  Status: 500

{
    "code": 500,
    "message": "Internal Error"
}