Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
メールフィールド一覧取得APIを調整 (#2278)
Browse files Browse the repository at this point in the history
Co-authored-by: ryuring <egashira@catchup.co.jp>
  • Loading branch information
kk-uchino and ryuring committed Apr 16, 2023
1 parent 6bdafd9 commit d80137b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/bc-mail/src/Service/MailFieldsService.php
Expand Up @@ -96,7 +96,13 @@ public function getIndex(int $mailContentId, array $queryParams = [])
$query->limit($queryParams['limit']);
}

$fields = $this->MailFields->getSchema()->columns();
if ($options['status'] === 'publish') {
if (empty($queryParams['contain'])) {
$query->contain(['MailContents' => ['Contents']])->select($fields);
} elseif (!isset($queryParams['contain']['MailContents']['Contents'])) {
$query->contain(array_merge_recursive($query->getContain(), ['MailContents' => ['Contents']]));
}
$conditions['use_field'] = true;
$conditions = array_merge($conditions, $this->MailFields->MailContents->Contents->getConditionAllowPublish());
}
Expand Down

0 comments on commit d80137b

Please sign in to comment.