Git Product home page Git Product logo

Comments (6)

manish591 avatar manish591 commented on July 29, 2024

@RitikJaiswal75 @apurvkhare @prakashchoudhary07 @sahsisunny @DashDeipayan @heyrandhir Please share your thoughts on this.

from website-api-contracts.

RitikJaiswal75 avatar RitikJaiswal75 commented on July 29, 2024

APIs Should represent the resource they are accessing I think it should just be
POST as PATCH here is used for a singular update, but the functionality of the API is to update multiple users

I would prefer the API name to be POST on `/users'
any action that it performs can go into the request body
something like

{
    action: "archive"
    on: "in_discord"
}

from website-api-contracts.

manish591 avatar manish591 commented on July 29, 2024

APIs Should represent the resource they are accessing I think it should just be POST as PATCH here is used for a singular update, but the functionality of the API is to update multiple users

I would prefer the API name to be POST on `/users' any action that it performs can go into the request body something like

{
    action: "archive"
    on: "in_discord"
}

There exists another API on the same endpoint /users. This API marks users unverified. If we go with this approach again we have to update the previously implemented API definition as well.

@prakashchoudhary07 @heyrandhir @apurvkhare What's you thoughts on this?

from website-api-contracts.

manish591 avatar manish591 commented on July 29, 2024

APIs Should represent the resource they are accessing I think it should just be POST as PATCH here is used for a singular update, but the functionality of the API is to update multiple users

I would prefer the API name to be POST on `/users' any action that it performs can go into the request body something like

{
    action: "archive"
    on: "in_discord"
}

Also, I don't understand why we used POST here. POST is supposed to be used when we are creating new resources. But, here we are just updating the existing archived property on the user's resources. Can you please explain?

from website-api-contracts.

heyrandhir avatar heyrandhir commented on July 29, 2024

There exists another API on the same endpoint /users. This API marks users unverified. If we go with this approach again we have to update the previously implemented API definition as well.

I think we would need to update the previous api then. Based on request body it should perform the unverified action. while as @RitikJaiswal75 suggested based on specific key such as

{
    action: "archive"
    on: "in_discord"
}

you can perform your action and similarly assign some other key for unverified action.

from website-api-contracts.

manish591 avatar manish591 commented on July 29, 2024

Based on this Discussion:

  1. For archive users not in discord API
  POST /users

  Request Body

  {
    "action": "archive",
    "on": "in_discord"
  }
  1. For marking users unverified in discord API
  POST /users

  Request Body

  {
    "action": "unverified",
    "on": "discord_unlinked"
  }

from website-api-contracts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.