🐛 Hotfix previous commit compile issue

This commit is contained in:
LittleSheep 2024-12-01 01:27:42 +08:00
parent 10e9813bea
commit f8492ea1af
2 changed files with 5 additions and 6 deletions

8
.idea/workspace.xml generated
View File

@ -4,11 +4,9 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":truck: Move make friendship api"> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":boom: Move remove member api arguments from body to querystring just as messaging">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/http/api/index.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/http/api/index.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/http/api/realm_members_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/http/api/realm_members_api.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/http/api/realm_members_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/http/api/realm_members_api.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/services/realms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/realms.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -161,7 +159,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value=":bug: Fix grpc namespace conflict" />
<MESSAGE value=":recycle: Replace nil context with context.Background in authkit" /> <MESSAGE value=":recycle: Replace nil context with context.Background in authkit" />
<MESSAGE value=":sparkles: Authkit support check user related permission" /> <MESSAGE value=":sparkles: Authkit support check user related permission" />
<MESSAGE value=":sparkles: Authkit can get user" /> <MESSAGE value=":sparkles: Authkit can get user" />
@ -186,7 +183,8 @@
<MESSAGE value=":sparkles: Better check in experience random algorithm" /> <MESSAGE value=":sparkles: Better check in experience random algorithm" />
<MESSAGE value=":sparkles: Better relationships stauts query" /> <MESSAGE value=":sparkles: Better relationships stauts query" />
<MESSAGE value=":truck: Move make friendship api" /> <MESSAGE value=":truck: Move make friendship api" />
<option name="LAST_COMMIT_MESSAGE" value=":truck: Move make friendship api" /> <MESSAGE value=":boom: Move remove member api arguments from body to querystring just as messaging" />
<option name="LAST_COMMIT_MESSAGE" value=":boom: Move remove member api arguments from body to querystring just as messaging" />
<option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" /> <option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">

View File

@ -76,6 +76,7 @@ func removeRealmMember(c *fiber.Ctx) error {
} }
user := c.Locals("user").(models.Account) user := c.Locals("user").(models.Account)
alias := c.Params("realm") alias := c.Params("realm")
memberId, _ := c.ParamsInt("memberId", 0)
realm, err := services.GetRealmWithAlias(alias) realm, err := services.GetRealmWithAlias(alias)
if err != nil { if err != nil {
@ -84,7 +85,7 @@ func removeRealmMember(c *fiber.Ctx) error {
var account models.Account var account models.Account
if err := database.C.Where(&models.Account{ if err := database.C.Where(&models.Account{
Name: data.Target, BaseModel: models.BaseModel{ID: uint(memberId)},
}).First(&account).Error; err != nil { }).First(&account).Error; err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error()) return fiber.NewError(fiber.StatusNotFound, err.Error())
} }