Unverified Commit 4abf684c authored by Fernando Takagi's avatar Fernando Takagi Committed by GitHub
Browse files

Allow StorageWriteRequest to accept undefined userId value in TypeScript to...

Allow StorageWriteRequest to accept undefined userId value in TypeScript to create a system owned object (#820)
parent 326c9af0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ require (
	github.com/gorilla/mux v1.8.0
	github.com/gorilla/websocket v1.4.2
	github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0
	github.com/heroiclabs/nakama-common v1.22.0
	github.com/heroiclabs/nakama-common v1.22.1-0.20220328201422-bed57ba110d8
	github.com/jackc/pgconn v1.10.0
	github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451
	github.com/jackc/pgtype v1.8.1
+2 −0
+12 −8
Original line number Diff line number Diff line
@@ -4166,6 +4166,9 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja.
			writeOp.Key = key

			userIDIn, ok := dataMap["userId"]
			if userIDIn == nil {
				userID = uuid.Nil
			} else {
				userIDStr, ok := userIDIn.(string)
				if !ok {
					panic(r.NewTypeError("expects 'userId' value to be a string"))
@@ -4175,6 +4178,7 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja.
				if err != nil {
					panic(r.NewTypeError("expects 'userId' value to be a valid id"))
				}
			}

			valueIn, ok := dataMap["value"]
			valueMap, ok := valueIn.(map[string]interface{})