@@ -22,28 +22,6 @@ export default class OrganizationsController {
2222 }
2323 }
2424
25- static async setImages ( req : Request , res : Response , next : NextFunction ) {
26- try {
27- const { applyInterestImage = [ ] , exploreAsGuestImage = [ ] } = req . files as {
28- applyInterestImage ?: Express . Multer . File [ ] ;
29- exploreAsGuestImage ?: Express . Multer . File [ ] ;
30- } ;
31-
32- const applyInterestFile = applyInterestImage [ 0 ] || null ;
33- const exploreAsGuestFile = exploreAsGuestImage [ 0 ] || null ;
34-
35- const newImages = await OrganizationsService . setImages (
36- applyInterestFile ,
37- exploreAsGuestFile ,
38- req . currentUser ,
39- req . organization
40- ) ;
41-
42- res . status ( 200 ) . json ( newImages ) ;
43- } catch ( error : unknown ) {
44- next ( error ) ;
45- }
46- }
4725 static async getAllUsefulLinks ( req : Request , res : Response , next : NextFunction ) {
4826 try {
4927 const links = await OrganizationsService . getAllUsefulLinks ( req . organization . organizationId ) ;
@@ -97,15 +75,6 @@ export default class OrganizationsController {
9775 }
9876 }
9977
100- static async getOrganizationImages ( req : Request , res : Response , next : NextFunction ) {
101- try {
102- const images = await OrganizationsService . getOrganizationImages ( req . organization . organizationId ) ;
103- res . status ( 200 ) . json ( images ) ;
104- } catch ( error : unknown ) {
105- next ( error ) ;
106- }
107- }
108-
10978 static async setOrganizationFeaturedProjects ( req : Request , res : Response , next : NextFunction ) {
11079 try {
11180 const { projectIds } = req . body ;
@@ -142,6 +111,20 @@ export default class OrganizationsController {
142111 }
143112 }
144113
114+ static async setPlatformLogoImage ( req : Request , res : Response , next : NextFunction ) {
115+ try {
116+ if ( ! req . file ) {
117+ throw new HttpException ( 400 , 'Invalid or undefined image data' ) ;
118+ }
119+
120+ const updatedOrg = await OrganizationsService . setPlatformLogoImage ( req . file , req . currentUser , req . organization ) ;
121+
122+ res . status ( 200 ) . json ( updatedOrg ) ;
123+ } catch ( error : unknown ) {
124+ next ( error ) ;
125+ }
126+ }
127+
145128 static async setNewMemberImage ( req : Request , res : Response , next : NextFunction ) {
146129 try {
147130 if ( ! req . file ) {
@@ -181,6 +164,20 @@ export default class OrganizationsController {
181164 }
182165 }
183166
167+ static async setPlatformDescription ( req : Request , res : Response , next : NextFunction ) {
168+ try {
169+ const updatedOrg = await OrganizationsService . setPlatformDescription (
170+ req . body . platformDescription ,
171+ req . currentUser ,
172+ req . organization
173+ ) ;
174+
175+ res . status ( 200 ) . json ( updatedOrg ) ;
176+ } catch ( error : unknown ) {
177+ next ( error ) ;
178+ }
179+ }
180+
184181 static async getOrganizationFeaturedProjects ( req : Request , res : Response , next : NextFunction ) {
185182 try {
186183 const featuredProjects = await OrganizationsService . getOrganizationFeaturedProjects ( req . organization . organizationId ) ;
0 commit comments