Merge branch 'v0.4.0' into v0.4.0_tunnel_docs

This commit is contained in:
Michael Quigley 2023-06-26 16:47:41 -04:00
commit badb3b6ce9
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -45,16 +45,19 @@ func (h *getFrontendDetailHandler) Handle(params metadata.GetFrontendDetailParam
logrus.Errorf("environment not matched for frontend '%d' for account '%v'", fe.Id, principal.Email)
return metadata.NewGetFrontendDetailNotFound()
}
shr, err := str.GetShare(fe.Id, trx)
if err != nil {
logrus.Errorf("error getting share for frontend '%d': %v", fe.Id, err)
return metadata.NewGetFrontendDetailInternalServerError()
}
return metadata.NewGetFrontendDetailOK().WithPayload(&rest_model_zrok.Frontend{
payload := &rest_model_zrok.Frontend{
ID: int64(fe.Id),
ShrToken: shr.Token,
ZID: fe.ZId,
CreatedAt: fe.CreatedAt.UnixMilli(),
UpdatedAt: fe.UpdatedAt.UnixMilli(),
})
}
if fe.PrivateShareId != nil {
shr, err := str.GetShare(*fe.PrivateShareId, trx)
if err != nil {
logrus.Errorf("error getting share for frontend '%d': %v", fe.Id, err)
return metadata.NewGetFrontendDetailInternalServerError()
}
payload.ShrToken = shr.Token
}
return metadata.NewGetFrontendDetailOK().WithPayload(payload)
}