u
This commit is contained in:
1 parent
4e42a01b97
commit
428d370874
8 files changed
+84
-44
No files matched your search
@@ -2,8 +2,8 @@ package db
|
||||
|
||||
import (
|
||||
"base-framework/pkg/config"
|
||||
"base-framework/pkg/reponse"
|
||||
"base-framework/pkg/router"
|
||||
"base-framework/pkg/utils/response"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
)
|
||||
@@ -18,19 +18,19 @@ func NewClient(c *router.Context) *Client {
|
||||
val, ok := c.Get("orgId")
|
||||
fmt.Println(val)
|
||||
if !ok {
|
||||
response.Error(c).Code(response.CodeInvalidOrgCode).Send()
|
||||
reponse.Error(c).Code(reponse.CodeInvalidOrgCode).Send()
|
||||
return nil
|
||||
}
|
||||
|
||||
orgId, ok := val.(string)
|
||||
if !ok || orgId == "" {
|
||||
response.Error(c).Code(response.CodeInvalidOrgCode).Send()
|
||||
reponse.Error(c).Code(reponse.CodeInvalidOrgCode).Send()
|
||||
return nil
|
||||
}
|
||||
|
||||
conn, ok := config.GetDB(orgId)
|
||||
if !ok || conn == nil {
|
||||
response.Error(c).Code(response.CodeInvalidOrgCode).Send()
|
||||
reponse.Error(c).Code(reponse.CodeInvalidOrgCode).Send()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user