Skip to content

Commit

Permalink
fix: recipient field
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmikita committed Jul 3, 2024
1 parent 0124a7c commit 6d793a3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions resources/js/src/fields/repeater/mixins/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export const init = {
apiCall() {
this.postID = notification.postId;

fetch(`${notification.repeater_rest_url}${this.postID}`, {
fetch(`${notification.repeaterRestUrl}${this.postID}`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-WP-Nonce': notification.rest_nonce,
'X-WP-Nonce': notification.restNonce,
},
body: JSON.stringify(this.type),
})
Expand Down
2 changes: 1 addition & 1 deletion resources/js/src/fields/repeater/mixins/inputsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const inputsHandler = {
headers: {
'Content-Type':
'application/x-www-form-urlencoded; charset=UTF-8',
'X-WP-Nonce': notification.rest_nonce,
'X-WP-Nonce': notification.restNonce,
},
body: data,
})
Expand Down
4 changes: 2 additions & 2 deletions resources/js/src/fields/section-repeater/mixins/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export const init = {
apiCall() {
this.postID = notification.postId;

fetch(`${notification.section_repeater_rest_url}${this.postID}`, {
fetch(`${notification.sectionRepeaterRestUrl}${this.postID}`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-WP-Nonce': notification.rest_nonce,
'X-WP-Nonce': notification.restNonce,
},
body: JSON.stringify(this.type),
})
Expand Down
8 changes: 4 additions & 4 deletions src/Admin/Scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ public function enqueueScripts($pageHook)
[
'ajaxurl' => admin_url('admin-ajax.php'),
'postId' => get_the_ID(),
'rest_nonce' => wp_create_nonce('wp_rest'),
'restNonce' => wp_create_nonce('wp_rest'),
'csrfToken' => wp_create_nonce('notification_csrf'),
'select_rest_url' => get_rest_url(null, 'notification/v1/repeater-field/select/'),
'repeater_rest_url' => get_rest_url(null, 'notification/v1/repeater-field/'),
'section_repeater_rest_url' => get_rest_url(null, 'notification/v1/section-repeater-field/'),
'selectRestUrl' => get_rest_url(null, 'notification/v1/repeater-field/select/'),
'repeaterRestUrl' => get_rest_url(null, 'notification/v1/repeater-field/'),
'sectionRepeaterRestUrl' => get_rest_url(null, 'notification/v1/section-repeater-field/'),
]
);

Expand Down
2 changes: 1 addition & 1 deletion src/Api/Controller/SelectInputController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function sendResponse(\WP_REST_Request $request)
if ($recipient) {
$input = $recipient->input();

$data['optiocns'] = $input->options;
$data['options'] = $input->options;
$data['pretty'] = $input->pretty;
$data['label'] = $input->label;
$data['checkbox_label'] = $input->checkboxLabel;
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Queries/UserQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ static function () use ($role) {
"SELECT u.ID, u.user_email, u.display_name
FROM $wpdb->users AS u
INNER JOIN $wpdb->usermeta AS m ON u.ID = m.user_id
WHERE m.meta_key = '{$wpdb->getBlogPrefix()}capabilities'
WHERE m.meta_key = '{$wpdb->get_blog_prefix()}capabilities'
AND m.meta_value LIKE %s",
'%\"' . $wpdb->escLike($role) . '\"%'
'%\"' . $wpdb->esc_like($role) . '\"%'
),
'ARRAY_A'
);
Expand Down

0 comments on commit 6d793a3

Please sign in to comment.