From a9c58393d36d221197b48884a1960e6126ab31d7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Jul 2021 15:53:25 +0200 Subject: Introduce contact form command --- shared/extra-utils/server/contact-form.ts | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 shared/extra-utils/server/contact-form.ts (limited to 'shared/extra-utils/server/contact-form.ts') 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 @@ -import * as request from 'supertest' -import { ContactForm } from '../../models/server' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' - -function sendContactForm (options: { - url: string - fromEmail: string - fromName: string - subject: string - body: string - expectedStatus?: number -}) { - const path = '/api/v1/server/contact' - - const body: ContactForm = { - fromEmail: options.fromEmail, - fromName: options.fromName, - subject: options.subject, - body: options.body - } - return request(options.url) - .post(path) - .send(body) - .expect(options.expectedStatus || HttpStatusCode.NO_CONTENT_204) -} - -// --------------------------------------------------------------------------- - -export { - sendContactForm -} -- cgit v1.2.3