Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/user/teams API endpoint only returning empty list #18484

Closed
Langenfeld opened this issue Jan 31, 2022 · 0 comments · Fixed by #18499
Closed

/user/teams API endpoint only returning empty list #18484

Langenfeld opened this issue Jan 31, 2022 · 0 comments · Fixed by #18499
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented

Comments

@Langenfeld
Copy link

Langenfeld commented Jan 31, 2022

Gitea Version

1.16.0

Git Version

Operating System

Linux and Windows

How are you running Gitea?

gitea.io download for Windows x64 and Linux x64

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

When calling GET on the /user/teams API endpoint, only an empty list is returned.

Tried this on several istances with the login user and sudoing into other users all resulting in an empty list (used API-Webpage and python requests). Did not user try.gitea.org as I was not able to create an organisation to test this.

Screenshots

No response

Gusted added a commit to Gusted/gitea that referenced this issue Jan 31, 2022
- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves go-gitea#18484
@Gusted Gusted added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Jan 31, 2022
techknowlogick added a commit that referenced this issue Feb 1, 2022
* COrrect use `UserID` in `SearchTeams`

- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves #18484

* Seperate searching specific user

* Add condition back

* Use correct struct type

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
zeripath pushed a commit to zeripath/gitea that referenced this issue Feb 1, 2022
Backport go-gitea#18499

* COrrect use `UserID` in `SearchTeams`

- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves go-gitea#18484

* Seperate searching specific user

* Add condition back

* Use correct struct type

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
zeripath added a commit that referenced this issue Feb 2, 2022
Backport #18499

* Correct use `UserID` in `SearchTeams`

- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves #18484

* Seperate searching specific user

* Add condition back

* Use correct struct type

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* COrrect use `UserID` in `SearchTeams`

- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves go-gitea#18484

* Seperate searching specific user

* Add condition back

* Use correct struct type

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants