11import archiver from 'archiver'
22import async from 'async'
3+ import { Request , Response } from "express" ;
34import * as response from '../response'
45import config from '../config'
56import { Note , User } from '../models'
67import { logger } from '../logger'
78import { generateAvatar } from '../letter-avatars'
89
9- export async function getMe ( req , res ) {
10+ export async function getMe ( req : Request , res : Response ) : Promise < void > {
1011 if ( ! req . isAuthenticated ( ) ) {
11- return res . status ( 401 ) . send ( {
12+ res . status ( 401 ) . send ( {
1213 status : 'forbidden'
1314 } )
15+ return
1416 }
1517
1618 const user = await User . findOne ( {
@@ -32,7 +34,7 @@ export async function getMe(req, res) {
3234 } )
3335}
3436
35- export async function deleteUser ( req , res ) {
37+ export async function deleteUser ( req : Request , res : Response ) : Promise < void > {
3638 if ( ! req . isAuthenticated ( ) ) {
3739 return response . errorForbidden ( req , res )
3840 }
@@ -55,7 +57,7 @@ export async function deleteUser(req, res) {
5557 return res . redirect ( config . serverURL + '/' )
5658}
5759
58- export function exportMyData ( req , res ) {
60+ export function exportMyData ( req : Request , res : Response ) : void {
5961 if ( ! req . isAuthenticated ( ) ) {
6062 return response . errorForbidden ( req , res )
6163 }
@@ -114,7 +116,7 @@ export function exportMyData(req, res) {
114116 } )
115117}
116118
117- export function getMyAvatar ( req , res ) {
119+ export function getMyAvatar ( req : Request , res : Response ) : void {
118120 res . setHeader ( 'Content-Type' , 'image/svg+xml' )
119121 res . setHeader ( 'Cache-Control' , 'public, max-age=86400' )
120122 res . send ( generateAvatar ( req . params . username ) )
0 commit comments