-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Codeowners, organize logsremover, organize consts
- Loading branch information
1 parent
37c93b1
commit 24d3e4c
Showing
9 changed files
with
33 additions
and
44 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @fadihanna123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Response } from 'express'; | ||
import { users } from '../consts'; | ||
import { User, typedRequestBody } from '../types'; | ||
import { users } from '../utils/consts'; | ||
import { typedRequestBody, User } from 'types'; | ||
|
||
/** | ||
* @author Fadi Hanna<[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
import { fileCleaner } from './fileClenaer'; | ||
import fs from 'fs'; | ||
|
||
/** | ||
* @author Fadi Hanna<[email protected]> | ||
*/ | ||
|
||
/** | ||
* Clean log and error data in the database and call fileCleaner. | ||
* Clean log and error files. | ||
* @function logsRemover | ||
* @async | ||
* @returns { Promise<void> } | ||
* @returns { void } | ||
* @example logsRemover(); | ||
*/ | ||
export const logsRemover = async (): Promise<void> => fileCleaner(); | ||
export const logsRemover = (): void => { | ||
const logsPath: string = './src/logs/debug.log'; | ||
const errorPath: string = './src/logs/error.log'; | ||
const newValue: string = ''; | ||
|
||
fs.promises | ||
.readFile(logsPath) | ||
.then(() => { | ||
fs.promises.writeFile(errorPath, newValue).catch((err: Error) => { | ||
if (err) { | ||
throw err; | ||
} | ||
|
||
console.log('Done cleaning'); | ||
}); | ||
}) | ||
.catch((err: Error) => { | ||
if (err) { | ||
throw err; | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { Request } from 'express'; | ||
|
||
/** | ||
* @author Fadi Hanna<[email protected]> | ||
*/ | ||
|
@@ -28,4 +29,4 @@ interface typedRequestBody<T> extends Request { | |
body: T; | ||
} | ||
|
||
export { Routes, User, typedRequestBody }; | ||
export { User, typedRequestBody, Routes }; |
File renamed without changes.