fix lint.

This commit is contained in:
Simon Larsen
2022-05-17 22:51:37 +01:00
parent 85be2e59c2
commit d8a3e2e54f
6 changed files with 24 additions and 30 deletions

View File

@@ -53,7 +53,7 @@ class User extends BaseModel {
update: false,
delete: false,
})
@TableColumn({title: "Email"})
@TableColumn({ title: 'Email' })
@UniqueColumn()
@RequiredColumn()
@Column({
@@ -80,7 +80,7 @@ class User extends BaseModel {
update: false,
delete: false,
})
@TableColumn({title: "Password"})
@TableColumn({ title: 'Password' })
@HashedColumn()
@Column({
type: ColumnType.HashedString,

View File

@@ -1,8 +0,0 @@
import BaseModel from '../../Models/BaseModel';
export default (displayAs: string) => {
return (target: Object, propertyKey: string) => {
const baseModel: BaseModel = target as BaseModel;
baseModel.addTableColumn(propertyKey, displayAs);
};
};

View File

@@ -25,12 +25,14 @@ const BasicForm = <T extends Object,>(props: ComponentProps<T>): ReactElement =>
const getFormField = (field: DataField<T>, index: number): ReactElement => {
let fieldType = "text";
let fieldType = "text";
if (Object.keys(field.field).length === 0) {
throw new BadDataException("Object cannot be without Field")
}
}
return (<div key={index}>
<Field type={fieldType} label={field.title} name={Object.keys(field.field)[0] as string} />
<label>{field.title}</label>
<p>{field.description}</p>
<Field type={fieldType} name={Object.keys(field.field)[0] as string} />
<ErrorMessage name={Object.keys(field.field)[0] as string} component="div" />
</div>)
}
@@ -49,14 +51,14 @@ const BasicForm = <T extends Object,>(props: ComponentProps<T>): ReactElement =>
props.onSubmit(values);
}}
>
{({ isSubmitting }) => (
<Form>
<h1>{ props.title}</h1>
<h1>{props.title}</h1>
{props.fields && props.fields.map((field: DataField<T>, i) => {
return getFormField(field, i);
})}
<Button title={ props.submitButtonText || "Submit" } disabled={isSubmitting} type={ButtonTypes.Submit} id={`${props.id}-submit-button`} />
<Button title={props.submitButtonText || "Submit"} disabled={isSubmitting} type={ButtonTypes.Submit} id={`${props.id}-submit-button`} />
</Form>
)}
</Formik>

View File

@@ -300,8 +300,8 @@ describe('Incoming HTTP Request API', function (): void {
});
});
it('should create an incident with incoming http request url', (done: $TSFixMe): void => {
axios({
it('should create an incident with incoming http request url', async (done: $TSFixMe): void => {
await axios({
method: 'post',
url: createIncidentUrl,
}).then((res: $TSFixMe): void => {
@@ -312,8 +312,8 @@ describe('Incoming HTTP Request API', function (): void {
});
});
it('should acknowledge an incident with an incoming http request url', (done: $TSFixMe): void => {
axios({
it('should acknowledge an incident with an incoming http request url', async (done: $TSFixMe): void => {
await axios({
method: 'post',
url: acknowledgeIncidentUrl,
}).then((res: $TSFixMe): void => {
@@ -324,8 +324,8 @@ describe('Incoming HTTP Request API', function (): void {
});
});
it('should resolve an incident with an incoming http request url', (done: $TSFixMe): void => {
axios({
it('should resolve an incident with an incoming http request url', async (done: $TSFixMe): void => {
await axios({
method: 'post',
url: resolveIncidentUrl,
}).then((res: $TSFixMe): void => {
@@ -336,9 +336,9 @@ describe('Incoming HTTP Request API', function (): void {
});
});
it('should add incident note with an incoming http request url', (done: $TSFixMe): void => {
it('should add incident note with an incoming http request url', async (done: $TSFixMe): void => {
// It should also work for a get request
axios({
await axios({
method: 'get',
url: incidentNoteUrl,
}).then((res: $TSFixMe): void => {
@@ -349,8 +349,8 @@ describe('Incoming HTTP Request API', function (): void {
});
});
it('should add internal note with an incoming http request url', (done: $TSFixMe): void => {
axios({
it('should add internal note with an incoming http request url', async (done: $TSFixMe): void => {
await axios({
method: 'get',
url: internalNoteUrl,
}).then((res: $TSFixMe): void => {

View File

@@ -100,7 +100,7 @@ router.post(
if (alreadySavedUser) {
// Send Welcome Mail
MailService.sendMail(
await MailService.sendMail(
user.email,
EmailSubjects.getSubjectByType(
EmailTemplateType.SIGNUP_WELCOME_EMAIL
@@ -117,7 +117,7 @@ router.post(
);
} else {
// Send EmailVerification Link because this is a new user.
MailService.sendMail(
await MailService.sendMail(
user.email,
EmailSubjects.getSubjectByType(
EmailTemplateType.SIGNUP_WELCOME_EMAIL

View File

@@ -2,8 +2,8 @@ import { JSONObjectOrArray } from 'Common/Types/JSON';
import io, { Socket } from 'CommonServer/Infrastructure/SocketIO';
import ObjectID from 'Common/Types/ObjectID';
io.sockets.on('connection', (socket: Socket) => {
socket.on('project', (projectId: ObjectID) => {
socket.join(projectId.toString());
socket.on('project', async (projectId: ObjectID) => {
await socket.join(projectId.toString());
});
});