mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
22 lines
546 B
TypeScript
22 lines
546 B
TypeScript
import { BaseService, RequestHelper } from '../infrastructure';
|
|
|
|
interface SearchOptions {
|
|
projectId: ProjectId;
|
|
groupId: string | number;
|
|
}
|
|
class Search extends BaseService {
|
|
all(scope: string, search: string, { projectId, groupId }: SearchOptions) {
|
|
let url = '';
|
|
|
|
if (projectId) {
|
|
url += `projects/${encodeURIComponent(projectId)}/`;
|
|
} else if (groupId) {
|
|
url += `groups/${encodeURIComponent(groupId)}/`;
|
|
}
|
|
|
|
return RequestHelper.get(this, `${url}search`, { scope, search });
|
|
}
|
|
}
|
|
|
|
export default Search;
|