Skip to content

Commit 656a8bb

Browse files
Merge pull request #42 from renderforest/implement-supports-resource-api
implement supports resource API:
2 parents e8cc34d + 2b3ef1e commit 656a8bb

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/lib/resources/supports.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright (c) 2018-present, Renderforest, LLC.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the license found in the
6+
* LICENSE file in the root directory.
7+
*/
8+
9+
const Http = require('../http/http')
10+
11+
const Params = require('../../util/params')
12+
13+
class Supports {
14+
/**
15+
* @param {Object} payload
16+
* @returns {Promise.<Object>}
17+
* @description Add Supports Ticket.
18+
*/
19+
static addSupportsTicket (payload) {
20+
const body = Params.destructParams(payload, ['message', 'mailType', 'subject'])
21+
22+
const options = {
23+
method: 'POST',
24+
endpoint: `${Supports.API_PREFIX}/supports/ticket`,
25+
body
26+
}
27+
return Http.authorizedRequest(options)
28+
}
29+
}
30+
31+
Supports.API_PREFIX = '/api/v1'
32+
33+
module.exports = Supports

0 commit comments

Comments
 (0)