代码之家  ›  专栏  ›  技术社区  ›  Yousra dechir

Axios Get无法识别数据库集合余额,但Put、Post或Patch无法识别

  •  0
  • Yousra dechir  · 技术社区  · 2 年前

    所以我有一个全栈React应用程序,这种类型的代码我在数据库中有数据。我可以通过Axios Get访问的集合,但Put无法访问这些数据来更新它,这是一个余额信用帐户,每当客户购买东西时,管理员接受订单,这个余额就会减少这个金额,我会发布一些图片,让任何人都能理解我想解释的内容, this is my collection on my db mongo compass the Axios get works perfecty Axios get Result consol.log Axios put that doesn't work result of Axios Put

    如何解决此问题?

    我期待Put Request工作。

    2 回复  |  直到 2 年前
        1
  •  0
  •   Dominic Henley    2 年前

    除非你的截图不完整,否则看起来 _id 未在函数体中定义。你好像忘了通过 _id 转换为函数作为参数。