|
@@ -2,6 +2,7 @@ package agent
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "wechat-api/ent"
|
|
|
"wechat-api/ent/agent"
|
|
|
|
|
|
"wechat-api/internal/svc"
|
|
@@ -31,7 +32,7 @@ func NewGetAgentByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetA
|
|
|
func (l *GetAgentByIdLogic) GetAgentById(req *types.IDReq) (*types.AgentInfoResp, error) {
|
|
|
organizationId := l.ctx.Value("organizationId").(uint64)
|
|
|
data, err := l.svcCtx.DB.Agent.Query().Where(agent.ID(req.Id), agent.OrganizationID(organizationId)).First(l.ctx)
|
|
|
- if err != nil {
|
|
|
+ if err != nil && !ent.IsNotFound(err) {
|
|
|
return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
}
|
|
|
|