Closed Takapy1 closed 1 year ago
@Ayato-kosaka 動作確認して、curlでplace作成しようとしたら以下のエラー出た。
$ curl -X POST -H "Content-Type:application/json" localhost:3000/PBL002 -d '{"place_id":"ChIJ8dLP9g1cGGAR9TVSa_OmvLs", "language":"ja"}'
{"statusCode":500,"message":"Internal server error"}
[Nest] 3123 - 2022/10/23 9:25:50 ERROR [ExceptionsHandler] Value for argument "data" is not a valid Firestore document. Detected an object of type "GeoPoint" that doesn't match the expected instance (found in field "geometry").
Please ensure that the Firestore types you are using are from the same NPM package.)
Error: Value for argument "data" is not a valid Firestore document. Detected an object of type "GeoPoint" that doesn't match the expected instance (found in field "geometry"). Please ensure that the Firestore types you are using are from the same NPM package.)
at validateUserInput (/Users/ganeshatakahiro/Documents/Spelive/spelieve-backend-place/node_modules/@google-cloud/firestore/build/src/serializer.js:332:15)
at Object.validateUserInput (/Users/ganeshatakahiro/Documents/Spelive/spelieve-backend-place/node_modules/@google-cloud/firestore/build/src/serializer.js:269:13)
at Object.validateDocumentData (/Users/ganeshatakahiro/Documents/Spelive/spelieve-backend-place/node_modules/@google-cloud/firestore/build/src/write-batch.js:588:18)
at CollectionReference.add (/Users/ganeshatakahiro/Documents/Spelive/spelieve-backend-place/node_modules/@google-cloud/firestore/build/src/reference.js:2087:23)
at PBL002UpsertPlaceDataService.doExecute (/Users/ganeshatakahiro/Documents/Spelive/spelieve-backend-place/src/PBL002UpsertPlaceData/PBL002UpsertPlaceData.service.ts:106:29)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at /Users/ganeshatakahiro/Documents/Spelive/spelieve-backend-place/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /Users/ganeshatakahiro/Documents/Spelive/spelieve-backend-place/node_modules/@nestjs/core/router/router-proxy.js:9:17
Geopointのところで引っかかってそうだけど、これはnpm install失敗しているかな?
@Takapy1 まじか、ちょっとみるわ
@Takapy1 firebase-admin/firestore と、firebase/firestore で export される Geopointクラスが違うみたい。。。 ゴミ仕様すぎるなぁ、、 とりあえず、Geopointクラスの意義も謎やから、Geopointの利用を廃止して、普通にObjectとして持つわ
そうそう、GeoPoint クラスの互換性がないみたい
でも、ちゃんと内部結合テストしないとだめだってことがわかってよかったわ!
@Ayato-kosaka これはゴミ仕様すぎた。 内部結合性テストって何かわからないので、月曜に教えてくれ
https://github.com/Ayato-kosaka/spelieve-common/commit/0df4186e25b29b89e3df2069dffe26a27f93eac0 でspelieve-common改修して caf0786 で動くようになったはず!
@Ayato-kosaka 試してみます。
@Ayato-kosaka MPlaceの作成、curlコマンドからできるようになったわ! 対応ありがとう!
あ!firestore.ts でdevelopコレクション噛ませてるからうまく疎通できないかも! https://github.com/Ayato-kosaka/spelieve/blob/develop/src/Itinerary/Endpoint/firestore.ts
出来なければ、↓の記載消したら出来るはず!(今日中には開発環境分けるようにするわ!)
if(process.env.NODE_ENV==='development'){
console.log(process.env.NODE_ENV)
db = doc(collection(getFirestore(app), 'develop'), 'GOKyrRFVtAffj6kSzKIc') as unknown as Firestore;
}
↑ @Takapy1
Placeのテスト用データが欲しいからバックエンドを動作させる
placeID検索に使用サイト