Skip to content

Commit

Permalink
Merge pull request #78 from FriendsOfREDAXO/install-url-profile-witho…
Browse files Browse the repository at this point in the history
…ut-warning

Fix Cronjob an RESTful Route API Definitions
  • Loading branch information
alxndr-w authored Jul 16, 2024
2 parents bb7e9b8 + a4c5523 commit 848aca1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 11 deletions.
45 changes: 34 additions & 11 deletions lib/neues_restful_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function init() :void {
'query' => Entry::query(),
'get' => [
'fields' => [
'rex_neues_entry' => [
'FriendsOfRedaxo\Neues\Entry' => [
'id',
'status',
'name',
Expand All @@ -26,33 +26,45 @@ public static function init() :void {
'lang_id',
'publishdate',
'author_id',
'category_ids',
'url',
'image',
'images',
'createdate',
'createuser',
'updatedate',
'updateuser',
'uuid',
],
'rex_neues_category' => [
'FriendsOfRedaxo\Neues\Category' => [
'id',
'name',
'image',
'status',
'createdate',
'createuser',
'updatedate',
'updateuser',
'uuid',
],
'rex_neues_author' => [
'FriendsOfRedaxo\Neues\Author' => [
'id',
'name',
'nickname',
'text',
'image',
'be_user_id',
'createdate',
'createuser',
'updatedate',
'updateuser',
'uuid',
],
],
],
'post' => [
'fields' => [
'rex_neues_entry' => [
'FriendsOfRedaxo\Neues\Entry' => [
'status',
'name',
'teaser',
Expand All @@ -73,7 +85,7 @@ public static function init() :void {
],
'delete' => [
'fields' => [
'rex_neues_entry' => [
'FriendsOfRedaxo\Neues\Entry' => [
'id',
],
],
Expand All @@ -92,26 +104,32 @@ public static function init() :void {
'query' => Category::query(),
'get' => [
'fields' => [
'rex_neues_category' => [
'FriendsOfRedaxo\Neues\Category' => [
'id',
'name',
'image',
'status',
'createdate',
'createuser',
'updatedate',
'updateuser',
'uuid',
],
],
],
'post' => [
'fields' => [
'rex_neues_category' => [
'FriendsOfRedaxo\Neues\Category' => [
'name',
'image',
'status',
'uuid',
],
],
],
'delete' => [
'fields' => [
'rex_neues_category' => [
'FriendsOfRedaxo\Neues\Category' => [
'id',
],
],
Expand All @@ -130,19 +148,24 @@ public static function init() :void {
'query' => Author::query(),
'get' => [
'fields' => [
'rex_neues_author' => [
'FriendsOfRedaxo\Neues\Author' => [
'id',
'name',
'nickname',
'text',
'image',
'be_user_id',
'createdate',
'createuser',
'updatedate',
'updateuser',
'uuid',
],
],
],
'post' => [
'fields' => [
'rex_neues_author' => [
'FriendsOfRedaxo\Neues\Author' => [
'name',
'nickname',
'text',
Expand All @@ -153,7 +176,7 @@ public static function init() :void {
],
'delete' => [
'fields' => [
'rex_neues_author' => [
'FriendsOfRedaxo\Neues\Author' => [
'id',
],
],
Expand Down
8 changes: 8 additions & 0 deletions lib/rex_cronjob_neues_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public function execute()

$neues_category->setValue('uuid', $category['uuid']);
$neues_category->setValue('name', $category['name']);
$neues_category->setValue('image', $category['image']);
$neues_category->setValue('status', $status);
$neues_category->setValue('createdate', $category['createdate']);
$neues_category->setValue('createuser', 'cronjob');
$neues_category->setValue('updatedate', $category['updatedate']);
$neues_category->setValue('updateuser', 'cronjob');
$neues_category->save();
}

Expand All @@ -56,6 +62,8 @@ public function execute()

$neues_author->setValue('uuid', $author['uuid']);
$neues_author->setValue('name', $author['name']);
$neues_author->setValue('nickname', $author['nickname']);
$neues_author->setValue('text', $author['text']);
$neues_author->save();
}

Expand Down

0 comments on commit 848aca1

Please sign in to comment.