diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-21 15:51:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-21 15:51:30 +0200 |
commit | a24bd1ed41b43790bab6ba789580bb4e85f07d85 (patch) | |
tree | a54b0f6c921ba83a6e909cd0ced325b2d4b8863c /shared/extra-utils/server/contact-form.ts | |
parent | 5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565 (diff) | |
parent | c63830f15403ac4e750829f27d8bbbdc9a59282c (diff) | |
download | PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.tar.gz PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.tar.zst PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.zip |
Merge branch 'next' into develop
Diffstat (limited to 'shared/extra-utils/server/contact-form.ts')
-rw-r--r-- | shared/extra-utils/server/contact-form.ts | 31 |
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 @@ | |||
1 | import * as request from 'supertest' | ||
2 | import { ContactForm } from '../../models/server' | ||
3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
4 | |||
5 | function 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 | |||
29 | export { | ||
30 | sendContactForm | ||
31 | } | ||