octocrab icon indicating copy to clipboard operation
octocrab copied to clipboard

Implement getting users and reopos by their respective IDs

Open InAnYan opened this issue 1 year ago • 3 comments

Closes #683.

Well, what I basically did is that I introduced UserRef and RepoRef.

They are enums with two variants: either full form (nickname, owner/name pair), or ids.

I implemented std::fmt::Display for them, so that it's easier to operate in API URLs.

No breaking changes!!

InAnYan avatar Sep 07 '24 12:09 InAnYan

This is my first PR in Rust, so, uh. It may be not ideal. But I'm ready to improve it

InAnYan avatar Sep 07 '24 12:09 InAnYan

CRUCIAL UPDATE: in order to get repository by id, you need to use repositories in the URL, not repos.

I'll update this later

InAnYan avatar Sep 08 '24 10:09 InAnYan

Another update:

To get user by name, /users/{login} should be used.

To get user by id, /user/{id} should be used.

InAnYan avatar Sep 17 '24 06:09 InAnYan

Seems like there's some breakage in tests 🙂

XAMPPRocky avatar Sep 20 '24 09:09 XAMPPRocky

I see now why the tests fail.

The thing I got very confused with is: why it worked in my project...

It worked because I used IDs, but not other things... Now I need to fix this

InAnYan avatar Sep 30 '24 09:09 InAnYan

@XAMPPRocky tests are fixed

InAnYan avatar Sep 30 '24 09:09 InAnYan

Thank you for your PR, and congrats on your first contribution! 🎉

XAMPPRocky avatar Sep 30 '24 09:09 XAMPPRocky