m2ms / fragalysis-frontend

The React, Redux frontend built by webpack
Other
1 stars 1 forks source link

Overriding current snapshot doesn't work correctly. #973

Open boriskovar-m2ms opened 2 years ago

boriskovar-m2ms commented 2 years ago

It seems that only action list is updated but not other aspects of given snapshot namely additional info, name, date time of creation etc.

boriskovar-m2ms commented 2 years ago

@alanbchristie does API /api/snapshots/ support methods PUT and PATCH? Because in the description there is

Djagno view to retrieve information about user sessions (snapshots) (GET). Also used for saving
session information (PUT, POST, PATCH)

But in the header it says:

Allow: GET, POST, HEAD, OPTIONS 
alanbchristie commented 2 years ago

The SnapshotsView has a SnapshotWriteSerializer that should operate for POST/PUT/PATCH supporting the fields: -

fields = ('id', 'type', 'title', 'author', 'description', 'created', 'data',
          'session_project', 'parent', 'children', 'additional_info')

It looks like that's all the fields in the corresponding DB table but I'm not familiar with the API so would need to experiment with it.

boriskovar-m2ms commented 2 years ago

Thank you. I will just try when I get to fixing this bug.

boriskovar-m2ms commented 2 years ago

@alanbchristie When trying to execute PUT or PATCH I get "HTTP 405 Method Not Allowed" back.

alanbchristie commented 2 years ago

The serialiser logic is documented as "based on whether the request is a GET or a POST, PUT or PATCH request" but clearly the code soes not match the comment. Investigating...