]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/extra-utils/server/contact-form.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / server / contact-form.ts
CommitLineData
a4101923
C
1import * as request from 'supertest'
2import { ContactForm } from '../../models/server'
3
4function sendContactForm (options: {
a1587156
C
5 url: string
6 fromEmail: string
7 fromName: string
8 subject: string
9 body: string
a4101923
C
10 expectedStatus?: number
11}) {
12 const path = '/api/v1/server/contact'
13
14 const body: ContactForm = {
15 fromEmail: options.fromEmail,
16 fromName: options.fromName,
4e9fa5b7 17 subject: options.subject,
a4101923
C
18 body: options.body
19 }
20 return request(options.url)
21 .post(path)
22 .send(body)
23 .expect(options.expectedStatus || 204)
24}
25
26// ---------------------------------------------------------------------------
27
28export {
29 sendContactForm
30}