snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Next Audit Date set to NULL when auditing via API

Open joepitt91 opened this issue 4 years ago • 7 comments

Please confirm you have done the following before posting your bug report:

Describe the bug When auditing assets via POST to the API endpoint /api/v1/hardware/audit the last audit date and location are correctly recorded, however, the next audit date is set to NULL, with nothing logged in storage/logs/laravel.log, including with Advanced Debugging APP_DEBUG=true enabled.

To Reproduce Steps to reproduce the behavior:

  1. Go to '/hardware/360' and note audit time and next audit time.
  2. Send a POST to the /api/v1/hardware/audit Endpoint with the asset_tag and location_id values set in the body
  3. Go back to /hardware/360 and notice audit time has updated and next audit time is gone.
  4. Audit the same asset via Bulk Audit page,
  5. Go back to /hardware/360 and notice audit time has updated and next audit time is back.

Expected behavior The next audit date should be set as per it is stated as being set in the API response body.

Screenshots

API response

{
    "status": "success",
    "messages": "Asset audit successfully logged.",
    "payload": {
        "asset_tag": "1234",
        "note": "",
        "next_audit_date": {
            "datetime": "2021-09-19 00:00:00",
            "formatted": "19.09.2021 00:00"
        }
    }
}

Server (please complete the following information):

  • Snipe-IT Version: v4.9.5 - build 4482 (master)
  • OS: Ubuntu 18.04.5
  • Web Server: Apache/2.4.29
  • PHP Version: 7.2.24

Desktop (please complete the following information):

  • OS: Win10
  • Browser C# System.Net.Http.HttpClient
  • Version .NET 4.8

Error Messages

No errors, API Response is HTTP 200, and says next audit has been set.

Additional context

  • Is this a fresh install or an upgrade? upgraded several times.
  • What OS and web server you're running Snipe-IT on: as above
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc): install.sh
  • Include what you've done so far in the installation, and if you got any error messages along the way.: added many assets, accessors, licenses, etc. no major errors throughout.
  • Indicate whether or not you've manually edited any data directly in the database: none

joepitt91 avatar Sep 19 '20 01:09 joepitt91