GithubHelp home page GithubHelp logo

10 個人設定 about camera-trap-api HOT 13 CLOSED

taibif avatar taibif commented on July 19, 2024
10 個人設定

from camera-trap-api.

Comments (13)

kelp404 avatar kelp404 commented on July 19, 2024

我覺得需要做 authorization,用 mixins/bulkUpdate( https://github.com/TaiBIF/camera-trap-api/blob/master/common/mixins/bulkWrite.js#L14-L18 )的話會讓任何人都能修改,例如 A 帳號去改 B 帳號的資料。

from camera-trap-api.

 avatar commented on July 19, 2024

Proposed format to attached to user object:

"settings": {
  "setting": {
    "hotkeys": [
      {
        "speciesName": "", // 物種名稱,從各計畫的 species_list 取得
        "hotkey": "" // 快速鍵
      },
      {
        "speciesName": "",
        "hotkey": ""
      },
    ]
  },
}

考慮到每個使用者可能有不同計畫的編輯需要,因此清單應該不需要和個別計畫綁在一起。

from camera-trap-api.

 avatar commented on July 19, 2024

@rwu823 請在 #31 使用者新增時把 10.1.2 的快速鍵設定寫入 user 物件?

from camera-trap-api.

rwu823 avatar rwu823 commented on July 19, 2024

aa0a653 已完成

API 用法

GET /ctp-user/me

如果有設定過會多一組 speciesKeys 欄位(會關連此 user 在所有計畫中有辨識出的物種), null 即由前端決定預設鍵

"speciesKeys" : {
      "空拍": "AR",
      "工作照": "WP",
      "定時測試": null,
      "鼬獾": null,
      "水鹿": null,
      "山羌": null
	}

更新與重置 hotkeys

PATCH /ctp-user/me/update

全所有 keys 送進來:

{
	"speciesKeys" : {
		"物種" : "KEY",
		"物種2" : "KEY2",
		"物種3" : "KEY3",
	}
}

重置為 default keys

{
	"speciesKeys" : null
}

from camera-trap-api.

oahehc avatar oahehc commented on July 19, 2024

這支 API success 的 response 有點怪, 建議回更新成功後的 user profile
image

image

from camera-trap-api.

 avatar commented on July 19, 2024

@rwu823 ?

from camera-trap-api.

oahehc avatar oahehc commented on July 19, 2024

PATCH /ctp-user/me/update
type PATCH 似乎沒設定 CORS
image

from camera-trap-api.

 avatar commented on July 19, 2024

在 f3b4c9 中加入 PATCH - 再看看是否 okay 了?

from camera-trap-api.

oahehc avatar oahehc commented on July 19, 2024

PATCH /ctp-user/me/update
response 200, 但 data 沒有更新, update 完再 get 還是舊的資料

from camera-trap-api.

 avatar commented on July 19, 2024

Kelp 更新過後請 @oahehc 再試一次?我可以幫忙確認。

from camera-trap-api.

oahehc avatar oahehc commented on July 19, 2024

還是一樣, submit success, 但 refresh 後 /me 中的 speciesKeys 還是舊資料沒有更新成功

/ctp-user/me/update response
image

/me result
image

from camera-trap-api.

kelp404 avatar kelp404 commented on July 19, 2024

資料是有更新的,只是預設值不會拿掉。
已經改成有設定 speciesKeys 後移除預設值。

from camera-trap-api.

 avatar commented on July 19, 2024

Implemented in v1 as #96

from camera-trap-api.

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.