georgematheos / vs-app-backend

Other
0 stars 0 forks source link

Proper way to remove visitor from visitations #6

Closed georgematheos closed 7 years ago

georgematheos commented 7 years ago

Right now I'm using a PATCH request which uses the op remove and the path /visitors/:username. This is fairly elegant, but originally, I'd planned on making the visitors object an array of user information. Thus, the way to index into it would be more like /visitors[index]. This won't work in the PATCH request since the index is unknown. We could leave this format and do the logic on the server side to convert everything to array format, but this isn't good form, since the format of the results returned in a GET request should be consistent with the format of a PATCH request. We could fudge it a bit, and just have a field instead of path called "username" or something similar. Alternatively, we could find a different HTTP verb to use.

georgematheos commented 7 years ago

Resolved by #5