-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
How to call an API via blueprint #63
Comments
Hey, got a little bit more further, I‘m trying to call the git endpoint like this: in config.php:
But pressing the button is always showing a dialog saying: However, I can see that the route is indeed installed at
Do you see something obviously wrong with what I am doing? Thanks! |
Since the lib you are using is exposing simple helper calls to routes you could just call them manually. 'bnomei.janitor.jobs' => [
'contentPush' => function (Kirby\Cms\Page $page = null, string $data = null) {
// $page => page object where the button as pressed
$git = new \Thathoff\GitContent\KirbyGitHelper();
$status = $git->push(); // does not work yet
$status = true;
return [
'status' => status ? 200 : 204,
'label' => 'Pushed content',
];
},
],
]; maybe @thathoff could add some return status values to the helpers |
Hey, I’m using this plugin: https://github.com/thathoff/kirby-git-content which creates an endpoint like
/git-content/push
and I’d like to add a button insite.yml
that calls that endpoint.This example https://github.com/bnomei/kirby3-janitor/wiki/Example:-Trigger-jons-with-JS-and-Panel-Vue shows how to call endpoints but I am not sure where would I place this code. Can you advice?
Thanks!
The text was updated successfully, but these errors were encountered: