mirror of
https://github.com/openziti/zrok.git
synced 2025-01-24 06:48:56 +01:00
fix for frontend detail handler
This commit is contained in:
parent
5d2d7b1b00
commit
881c263132
@ -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)
|
logrus.Errorf("environment not matched for frontend '%d' for account '%v'", fe.Id, principal.Email)
|
||||||
return metadata.NewGetFrontendDetailNotFound()
|
return metadata.NewGetFrontendDetailNotFound()
|
||||||
}
|
}
|
||||||
shr, err := str.GetShare(fe.Id, trx)
|
payload := &rest_model_zrok.Frontend{
|
||||||
|
ID: int64(fe.Id),
|
||||||
|
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 {
|
if err != nil {
|
||||||
logrus.Errorf("error getting share for frontend '%d': %v", fe.Id, err)
|
logrus.Errorf("error getting share for frontend '%d': %v", fe.Id, err)
|
||||||
return metadata.NewGetFrontendDetailInternalServerError()
|
return metadata.NewGetFrontendDetailInternalServerError()
|
||||||
}
|
}
|
||||||
return metadata.NewGetFrontendDetailOK().WithPayload(&rest_model_zrok.Frontend{
|
payload.ShrToken = shr.Token
|
||||||
ID: int64(fe.Id),
|
}
|
||||||
ShrToken: shr.Token,
|
return metadata.NewGetFrontendDetailOK().WithPayload(payload)
|
||||||
ZID: fe.ZId,
|
|
||||||
CreatedAt: fe.CreatedAt.UnixMilli(),
|
|
||||||
UpdatedAt: fe.UpdatedAt.UnixMilli(),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user