Skip to content
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

Update nextcloud axios and fix php files style #273

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Db/RoomMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public function search(string $userId, string $query): array {
->from($this->tableName, 'r')
->where($qb->expr()->eq('r.user_id', $qb->createNamedParameter($userId)))
->andwhere($qb->expr()->ILike('name',
$qb->createNamedParameter('%' . $this->db->escapeLikeParameter($query) . '%', IQueryBuilder::PARAM_STR),
IQueryBuilder::PARAM_STR));
$qb->createNamedParameter('%' . $this->db->escapeLikeParameter($query) . '%', IQueryBuilder::PARAM_STR),
IQueryBuilder::PARAM_STR));

/** @var array<Room> */
return $this->findEntities($qb);
Expand Down
20 changes: 9 additions & 11 deletions lib/Search/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

use OCA\BigBlueButton\AppInfo\Application;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Db\Room;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\Search\IProvider;
use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Search\SearchResultEntry;
use function array_map;

class Provider implements IProvider {
/** @var RoomService */
Expand Down Expand Up @@ -42,14 +40,14 @@ public function getName(): string {

public function getOrder(string $route, array $routeParameters): int {
if (strpos($route, Application::ID . '.') === 0) {
return -1;
}
return -1;
}
return Application::ORDER;
}

private function getAccess(string $access): string {
switch ($access) {
case 'public':
case 'public':
$translatedAccess = $this->l10n->t('Public');
break;
case 'password':
Expand All @@ -71,15 +69,15 @@ private function getAccess(string $access): string {
return $translatedAccess;
}

public function search(IUser $user, ISearchQuery $query): SearchResult {
public function search(IUser $user, ISearchQuery $query): SearchResult {
$rooms = $this->service->search(
$user,
$query
);

$results = [];

foreach($rooms as $room) {
foreach ($rooms as $room) {
$results[] = new SearchResultEntry(
'',
$room->getName(),
Expand All @@ -89,9 +87,9 @@ public function search(IUser $user, ISearchQuery $query): SearchResult {
);
}

return SearchResult::complete(
return SearchResult::complete(
'BBB',
$results
$results
);
}
}
}
}
2 changes: 1 addition & 1 deletion lib/Service/RoomService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IUser;
use OCP\Security\ISecureRandom;
use OCP\Search\ISearchQuery;
use OCP\Security\ISecureRandom;

class RoomService {
/** @var RoomMapper */
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@commitlint/travis-cli": "^16.2.3",
"@nextcloud/axios": "^1.3.2",
"@nextcloud/axios": "^1.11.0",
"@nextcloud/dialogs": "^3.1.2",
"@nextcloud/router": "^2.0.0",
"@octokit/rest": "^18.0.4",
Expand Down
Loading