workspaces добавлено
This commit is contained in:
@@ -13,31 +13,17 @@ import (
|
||||
)
|
||||
|
||||
type PlacementDetails struct {
|
||||
WorkspaceID string
|
||||
ProjectID string
|
||||
PlacementID string
|
||||
BackState bot.State
|
||||
}
|
||||
|
||||
func (s *PlacementDetails) Enter(b *bot.Bot, mode bot.RenderMode) {
|
||||
jwt := b.Session.JWT
|
||||
if jwt == "" {
|
||||
log.Error().Msg("JWT is empty in session")
|
||||
b.SendNew("❌ Ошибка авторизации. Попробуйте /start", Keyboard())
|
||||
return
|
||||
}
|
||||
|
||||
s.renderDetails(b, mode, jwt)
|
||||
s.renderDetails(b, mode)
|
||||
}
|
||||
|
||||
func (s *PlacementDetails) renderDetails(b *bot.Bot, mode bot.RenderMode, jwt string) {
|
||||
placement, err := b.Backend.GetPlacement(
|
||||
context.Background(),
|
||||
jwt,
|
||||
s.WorkspaceID,
|
||||
s.ProjectID,
|
||||
s.PlacementID,
|
||||
)
|
||||
func (s *PlacementDetails) renderDetails(b *bot.Bot, mode bot.RenderMode) {
|
||||
placement, err := b.Backend.GetPlacement(context.Background(), b.Session.JWT, b.Session.WorkspaceID, s.ProjectID, s.PlacementID)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to get placement")
|
||||
b.SendNew("❌ Не удалось загрузить размещение", Keyboard())
|
||||
|
||||
Reference in New Issue
Block a user