diff --git a/frontend/src/Account/tests/Account.test.tsx b/frontend/src/Account/tests/Account.test.tsx index da92cdf..4bf51df 100644 --- a/frontend/src/Account/tests/Account.test.tsx +++ b/frontend/src/Account/tests/Account.test.tsx @@ -1,12 +1,12 @@ -import * as React from "react"; - -import { shallow } from "enzyme"; -import { AccountComponent } from "../Account"; - -describe("", () => { - it("should say hello", () => { - const wrapper = shallow(); - - expect(wrapper.text()).toBe("Hello"); - }); -}); +import * as React from "react"; + +import { shallow } from "enzyme"; +import { AccountComponent } from "../Account"; + +describe("", () => { + it("should say hello", () => { + const wrapper = shallow(); + + expect(wrapper.text()).toBe("Hello"); + }); +}); diff --git a/frontend/src/Documents/DocumentsList.tsx b/frontend/src/Documents/DocumentsList.tsx index 6ec1407..fd72c19 100644 --- a/frontend/src/Documents/DocumentsList.tsx +++ b/frontend/src/Documents/DocumentsList.tsx @@ -10,7 +10,7 @@ export interface IDocumentListProps { } export function DocumentsList(props: IDocumentListProps) { - const cards = props.docs.map(doc => ( + const cards = props.docs.map((doc) => ( )); diff --git a/frontend/src/Home/Home.scss b/frontend/src/Home/Home.scss index 98c31b3..9c7d4c3 100644 --- a/frontend/src/Home/Home.scss +++ b/frontend/src/Home/Home.scss @@ -28,7 +28,7 @@ // keeps the breadcrumbs from taking all the space max-width: 70%; } - + * { transition: 0.3s; } @@ -50,4 +50,4 @@ .bp3-navbar { transition: 0.3s; } -} \ No newline at end of file +} diff --git a/frontend/src/redux/docs/reducer.ts b/frontend/src/redux/docs/reducer.ts index 3008163..78b27a2 100644 --- a/frontend/src/redux/docs/reducer.ts +++ b/frontend/src/redux/docs/reducer.ts @@ -53,7 +53,7 @@ export const docsReducer: Reducer = ( return { ...defaultDocsState, fetching: true }; case DocsTypes.DOCS_FETCH_SUCCESS: { const all: { [key: number]: IDocumentEntry } = {}; - action.payload.all.forEach(doc => { + action.payload.all.forEach((doc) => { all[doc.id] = { ...doc, remote: doc, dirty: false }; }); return { ...defaultDocsState, all }; @@ -90,7 +90,7 @@ export const docsReducer: Reducer = ( } case DocsTypes.DOCS_UPLOAD_SUCCESS: { const all: { [key: number]: IDocumentEntry } = { ...state.all }; - action.payload.all.forEach(doc => { + action.payload.all.forEach((doc) => { if (isDocDirty(all[doc.id], doc)) { all[doc.id] = { ...all[doc.id], remote: doc, dirty: true }; } else { @@ -130,7 +130,7 @@ export const docsReducer: Reducer = ( shared: payload.shared, dirty: false, }; - const dirtyDocs = Object.values(all).filter(e => e.dirty); + const dirtyDocs = Object.values(all).filter((e) => e.dirty); dirty = dirtyDocs.length > 0; } return { ...state, all, dirty }; diff --git a/frontend/src/redux/docs/sagas.ts b/frontend/src/redux/docs/sagas.ts index ace02e8..85475a7 100644 --- a/frontend/src/redux/docs/sagas.ts +++ b/frontend/src/redux/docs/sagas.ts @@ -139,7 +139,7 @@ function* docsUploadStart(action: IDocsUploadStartAction) { const allDocs = state.docs.all; const changedDocs: IDocumentJSON[] = Object.values(allDocs).filter( - e => e.dirty, + (e) => e.dirty, ); const updatedDocs: IDocumentJSON[] = []; diff --git a/src/entity/Document.ts b/src/entity/Document.ts index c2cbb55..64e5a2b 100644 --- a/src/entity/Document.ts +++ b/src/entity/Document.ts @@ -23,10 +23,7 @@ export class Document extends BaseEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - type => User, - user => user.documents, - ) + @ManyToOne((type) => User, (user) => user.documents) public user: User; @Column({ length: 190 }) diff --git a/src/entity/User.ts b/src/entity/User.ts index e6c8d4f..e1d6d24 100644 --- a/src/entity/User.ts +++ b/src/entity/User.ts @@ -40,10 +40,7 @@ export class User extends BaseEntity { @Column({ length: 190 }) public passwordHash: string; - @OneToMany( - type => Document, - document => document.user, - ) + @OneToMany((type) => Document, (document) => document.user) public documents: Document[]; constructor(username: string, email: string) { diff --git a/src/routes/docs.ts b/src/routes/docs.ts index 4d87cd2..4f7a362 100644 --- a/src/routes/docs.ts +++ b/src/routes/docs.ts @@ -4,7 +4,7 @@ import { User } from "~entity/User"; export const docsRouter = new Router(); -docsRouter.post("/docs/new", async ctx => { +docsRouter.post("/docs/new", async (ctx) => { if (!ctx.state.user) { ctx.throw(401); } @@ -35,7 +35,7 @@ docsRouter.post("/docs/new", async ctx => { }; }); -docsRouter.patch("/docs/byID/:id", async ctx => { +docsRouter.patch("/docs/byID/:id", async (ctx) => { if (!ctx.state.user) { ctx.throw(401); } @@ -85,7 +85,7 @@ docsRouter.patch("/docs/byID/:id", async ctx => { }; }); -docsRouter.get("/docs/list", async ctx => { +docsRouter.get("/docs/list", async (ctx) => { if (!ctx.state.user) { ctx.throw(401); } @@ -96,11 +96,11 @@ docsRouter.get("/docs/list", async ctx => { ctx.body = { error: false, - data: documents.map(document => document.toJSON(user.id)), + data: documents.map((document) => document.toJSON(user.id)), }; }); -docsRouter.get("/docs/byID/:id", async ctx => { +docsRouter.get("/docs/byID/:id", async (ctx) => { if (!ctx.state.user) { ctx.throw(401); } @@ -127,7 +127,7 @@ docsRouter.get("/docs/byID/:id", async ctx => { }; }); -docsRouter.get("/docs/shared/:username/:id", async ctx => { +docsRouter.get("/docs/shared/:username/:id", async (ctx) => { const { id, username } = ctx.params as { id: number | undefined; username: string | undefined; @@ -159,7 +159,7 @@ docsRouter.get("/docs/shared/:username/:id", async ctx => { }; }); -docsRouter.delete("/docs/byID/:id", async ctx => { +docsRouter.delete("/docs/byID/:id", async (ctx) => { if (!ctx.state.user) { ctx.throw(401); } diff --git a/src/server.ts b/src/server.ts index 6060169..f3bd53b 100644 --- a/src/server.ts +++ b/src/server.ts @@ -3,9 +3,9 @@ import { config } from "~config"; import { connect } from "~config/database"; connect() - .then(async connection => { + .then(async (connection) => { console.log(`connected to ${connection.name}`); app.listen(config.port); console.log(`listening at ${config.port}`); }) - .catch(error => console.log(error)); + .catch((error) => console.log(error));