mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Fix marshal payload
This commit is contained in:
parent
09d2c32610
commit
967a3b0330
1 changed files with 15 additions and 7 deletions
|
@ -60,16 +60,24 @@ func (c *coordinatorClient) Name() (name string) {
|
|||
}
|
||||
|
||||
func (c *coordinatorClient) ChangeStatus(ctx context.Context, spaceId string, conf *coordinatorproto.DeletionConfirmPayloadWithSignature) (status *coordinatorproto.SpaceStatusPayload, err error) {
|
||||
confMarshalled, err := conf.Marshal()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = c.doClient(ctx, func(cl coordinatorproto.DRPCCoordinatorClient) error {
|
||||
resp, err := cl.SpaceStatusChange(ctx, &coordinatorproto.SpaceStatusChangeRequest{
|
||||
var req *coordinatorproto.SpaceStatusChangeRequest
|
||||
if conf != nil {
|
||||
confMarshalled, err := conf.Marshal()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = &coordinatorproto.SpaceStatusChangeRequest{
|
||||
SpaceId: spaceId,
|
||||
DeletionPayload: confMarshalled,
|
||||
DeletionPayloadType: coordinatorproto.DeletionPayloadType_Confirm,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
req = &coordinatorproto.SpaceStatusChangeRequest{
|
||||
SpaceId: spaceId,
|
||||
}
|
||||
}
|
||||
err = c.doClient(ctx, func(cl coordinatorproto.DRPCCoordinatorClient) error {
|
||||
resp, err := cl.SpaceStatusChange(ctx, req)
|
||||
if err != nil {
|
||||
return rpcerr.Unwrap(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue