Skip to content

feat: Added list method functionality to API#30

Merged
lukeskywalker22 merged 3 commits into
mainfrom
feat/list-method
May 14, 2026
Merged

feat: Added list method functionality to API#30
lukeskywalker22 merged 3 commits into
mainfrom
feat/list-method

Conversation

@lukeskywalker22
Copy link
Copy Markdown
Contributor

Implemented list method to list all timetables from database

def list(self, **filters: typing.Any) -> "list[campus.model.TimetableMetadata]":
        """List timetables matching the provided filters.

        Args:
            **filters: Arbitrary filter parameters applied to the query.

        Returns:
            list[campus.model.TimetableMetadata]: Matching timetable metadata objects.
        """
        resp = self.client.get(self.make_path(), query=filters if filters else None)
        resp.raise_for_status()
        return [
            campus.model.TimetableMetadata.from_resource(item)
            for item in resp.json()
        ]

Copy link
Copy Markdown
Contributor

@ngjunsiang ngjunsiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests don't do anything useful, only mock the API schema which is unnecessary: we control the API on both ends (server and client)

Remove the gitignore change and the test and should be good to merge

@lukeskywalker22 lukeskywalker22 merged commit 8ff7dac into main May 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants