Commit 6cdac5f 1 parent 9a51769 commit 6cdac5f Copy full SHA for 6cdac5f
File tree 3 files changed +7
-13
lines changed
3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 1
- export const categories = [ 'logo' , 'aduan ' ]
1
+ export const categories = [ 'logo' , 'sapawarga ' ]
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import Handler from './delivery/http/handler'
5
5
import Repository from './repository/mongo/repository'
6
6
import { Config } from '../../config/config.interface'
7
7
import S3 from '../../external/s3'
8
- import Jwt from '../../pkg/jwt'
9
- import { VerifyAuth } from '../../transport/http/middleware/verifyAuth'
10
8
11
9
class Images {
12
10
constructor (
@@ -37,14 +35,7 @@ class Images {
37
35
private httpPrivate ( handler : Handler ) {
38
36
const Router = this . http . Router ( )
39
37
40
- const auth = new Jwt ( this . config . jwt . access_key )
41
-
42
- Router . post (
43
- '/' ,
44
- VerifyAuth ( auth ) ,
45
- this . http . Upload ( 'file' ) ,
46
- handler . Store ( )
47
- )
38
+ Router . post ( '/' , this . http . Upload ( 'file' ) , handler . Store ( ) )
48
39
49
40
this . http . SetRouter ( '/v1/images' , Router )
50
41
}
Original file line number Diff line number Diff line change @@ -20,8 +20,11 @@ class Usecase {
20
20
}
21
21
22
22
public async Store ( body : Store ) {
23
- const newPath = CustomPathFile ( getSlug ( body . category ) , body . file )
24
- body . title = body . title ?? body . file . originalname . replace ( RegexExtensionImage , '' )
23
+ const category = getSlug ( body . category )
24
+ const newPath = CustomPathFile ( category , body . file )
25
+ body . title =
26
+ body . title ??
27
+ body . file . originalname . replace ( RegexExtensionImage , '' )
25
28
body . tags . push ( body . title , body . category )
26
29
const source = readFileSync ( body . file . path )
27
30
You can’t perform that action at this time.
0 commit comments