aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/server/contact-form.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-06 15:53:25 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commita9c58393d36d221197b48884a1960e6126ab31d7 (patch)
treeb504eeefd6449d26122a7ee69affa24d242c70da /shared/extra-utils/server/contact-form.ts
parent2d1ad5b96063d1e430ca99128a15e2e56cb614e0 (diff)
downloadPeerTube-a9c58393d36d221197b48884a1960e6126ab31d7.tar.gz
PeerTube-a9c58393d36d221197b48884a1960e6126ab31d7.tar.zst
PeerTube-a9c58393d36d221197b48884a1960e6126ab31d7.zip
Introduce contact form command
Diffstat (limited to 'shared/extra-utils/server/contact-form.ts')
-rw-r--r--shared/extra-utils/server/contact-form.ts31
1 files changed, 0 insertions, 31 deletions
diff --git a/shared/extra-utils/server/contact-form.ts b/shared/extra-utils/server/contact-form.ts
deleted file mode 100644
index 6c9232cc6..000000000
--- a/shared/extra-utils/server/contact-form.ts
+++ /dev/null
@@ -1,31 +0,0 @@
1import * as request from 'supertest'
2import { ContactForm } from '../../models/server'
3import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4
5function sendContactForm (options: {
6 url: string
7 fromEmail: string
8 fromName: string
9 subject: string
10 body: string
11 expectedStatus?: number
12}) {
13 const path = '/api/v1/server/contact'
14
15 const body: ContactForm = {
16 fromEmail: options.fromEmail,
17 fromName: options.fromName,
18 subject: options.subject,
19 body: options.body
20 }
21 return request(options.url)
22 .post(path)
23 .send(body)
24 .expect(options.expectedStatus || HttpStatusCode.NO_CONTENT_204)
25}
26
27// ---------------------------------------------------------------------------
28
29export {
30 sendContactForm
31}