domjudge icon indicating copy to clipboard operation
domjudge copied to clipboard

Deactivated contests still show up in API

Open meisterT opened this issue 1 year ago • 4 comments

After we deactivate a contest, it is gone from dropdowns etc. in the web interface, but it is still available in the API. I would argue, it should also disappear in the API after deactivation.

meisterT avatar Sep 16 '24 05:09 meisterT

Can I try to handle it? Should I do it in the latest main branch? Thank you.

as6325400 avatar Sep 27 '24 06:09 as6325400

Isn't this already implemented: https://github.com/DOMjudge/domjudge/blob/a75c73a19efe0fb729568f2fcb5625c823ee1002/webapp/src/Controller/API/ContestController.php#L140

Kevinjil avatar Sep 27 '24 07:09 Kevinjil

Good find Kevin! This has been added by @thijskh in https://github.com/DOMjudge/domjudge/commit/5fd1413bc9012310052e926a842cf3692f34b96d originally.

My personal opinion is that we should be consistent between UI and API and change the default to filter out deactivated contests.

WDYT?

meisterT avatar Sep 28 '24 10:09 meisterT

Good find Kevin! This has been added by @thijskh in 5fd1413 originally.

My personal opinion is that we should be consistent between UI and API and change the default to filter out deactivated contests.

WDYT?

So to add a flag alsoInactive and default only show active contests? Makes sense to me.

vmcj avatar Sep 28 '24 12:09 vmcj

@vmcj my suggestion would not be to add a separate flag, but just to change the default value of the existing onlyActive flag to true.

meisterT avatar Nov 13 '24 19:11 meisterT

Note that we currently DO do this for the root contest endpoint but not for subendpoints like api/contests/xxx/teams. We should be consistent.

nickygerritsen avatar Jul 05 '25 20:07 nickygerritsen