Which one is easier to develop and work with (which saves the most time)? Which one would you go for? The name of the API represents its true purpose in this case by the way, createOrUpdate creates or updates the passed in meeting and create just creates the meeting. I will be the only one working on this project for now, although obviously, I would like others to work on it with me eventually.

  • fabian@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Well, it makes the client-side calls a bit simpler if you don’t distinguish create and update via POST/PUT, so at the server-side you have a single POST endpoint which does the upsert, but there it would be sensible to dispatch to separate methods for insert and update each.

  • Joe@kbin.social
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I would have 2 functions: createMeeting and updateMeeting

    No point having one function do two different things, especially if one of them isn’t even hinted at by the function name