Skip to content

feat: added ical api#40

Merged
sitepark-becker merged 17 commits intomainfrom
feature/ical-api
Jan 24, 2025
Merged

feat: added ical api#40
sitepark-becker merged 17 commits intomainfrom
feature/ical-api

Conversation

@sitepark-becker
Copy link
Copy Markdown
Contributor

@sitepark-becker sitepark-becker commented Dec 12, 2024

  • Adds an endpoint /api/ical that creates an .ical file from the scheduling data of a given resource. Expects one of two parameters:
    • parameter location: the controller will load the resource directly from the given location.
    • parameter id: the controller will search for the resource by the id. Useful for external resources.
  • Add a field iCalUrl to the graphql type EventTeaser + Resolvers

@sitepark-becker sitepark-becker self-assigned this Dec 12, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.90%. Comparing base (1390482) to head (1af1be9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #40      +/-   ##
============================================
+ Coverage     99.89%   99.90%   +0.01%     
- Complexity      247      281      +34     
============================================
  Files            13       16       +3     
  Lines           927     1031     +104     
============================================
+ Hits            926     1030     +104     
  Misses            1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sitepark-becker sitepark-becker marked this pull request as ready for review December 12, 2024 14:29
Comment thread src/Controller/ICalController.php Outdated
Comment thread src/Controller/ICalController.php Outdated
if (!empty($id)) {
return $this->createICalResponseById($id);
}
$res = new JsonResponse(['error' => 'Either provide an \'id\' or a \'location\' of a resource']);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To have a standardized error format. I used this in the form-bundle api-problem-bundle. See also here.

Comment thread src/Controller/ICalController.php
Comment thread src/Service/GraphQL/Resolver/Resource/ResourceICalUrlResolver.php
@sitepark-veltrup
Copy link
Copy Markdown
Member

sitepark-veltrup commented Jan 22, 2025

PHP 8.4:

  Problem 1
    - Root composer.json requires phpro/api-problem-bundle ^1.9 -> satisfiable by phpro/api-problem-bundle[1.9.0].
    - phpro/api-problem-bundle 1.9.0 requires php ~8.1.0 || ~8.2.0 || ~8.3.0 -> your php version (8.4.3) does not satisfy that requirement.

Unfortunately not yet supported.

See phpro/api-problem-bundle#27

Comment thread composer.json Outdated
@sitepark-veltrup
Copy link
Copy Markdown
Member

In order for "verify" to run without errors, php 8.4 must be removed from the workflow:

https://github.com/sitepark/atoolo-events-calendar-bundle/blob/main/.github/workflows/verify.yml#L16

@sitepark-becker sitepark-becker merged commit 1dea5f3 into main Jan 24, 2025
@sitepark-becker sitepark-becker deleted the feature/ical-api branch January 24, 2025 13:51
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