Skip to content

Attachments in apis #3264

@chetanmekha

Description

@chetanmekha

Hello Folks,
I want to perform operation where attachments are coming as a parameter. How can we achieve it?

Customerfeedback.remoteMethod(
        'sendFeedback', {
            http: {
                path: '/sendFeedback',
                verb: 'post'
            },
            returns: [{
                arg: 'records',
                type: 'array'
            },
            {
                arg: 'status',
                type: 'string'
            },
            {
                arg: 'statusDescription',
                type: 'string'
            },
            ],
            accepts: [{
                arg: 'customerFeedback',
                type: 'Object',
                http: { source: 'body' }
            }, {
                arg: 'file1',
                type: 'string',
                required: false
            }, {
                arg: 'file2',
                type: 'string',
                required: false
            },
            {
                arg: 'env',
                type: 'string'
            }, {
                arg: 'logUser',
                type: 'string'
            }]
        }
    );

What type we need to define for file1/file2 so It will act like an attachment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions