Skip to content

Search.all() url problem #83

@LogansUA

Description

@LogansUA

Hello. I'm trying to use search API. Here's my example:

const GitLab = require('node-gitlab-api').default;

const gitlabInstance = new GitLab({
    url: 'http://gitlab.com',
    token: process.env.GITLAB_TOKEN,
});

gitlabInstance.Search.all('project', 'json')
    .then(console.log)
    .catch(console.log);

In result i receive an error which contains

body: { error: '404 Not Found' } 

The reason, I think, in the path which equals: path: '/api/v4/undefinedsearch?scope=project&search=json'

Here's the options of request i get:

options:
   { url: 'http://gitlab.com/api/v4/undefinedsearch',
     headers: { 'private-token': '%my_private_token%' },
     json: true,
     qs: { scope: 'project', search: 'json' },
     resolveWithFullResponse: true,
     method: 'GET',
     callback: [Function: RP$callback],
     transform: undefined,
     simple: true,
     transform2xxOnly: false },

Versions:

node@10.1.0
node-gitlab-api@3.0.2

Thank you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions