File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
libraries/nestjs-libraries/src/integrations/social Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,12 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
423
423
let mediaBuffer : Buffer ;
424
424
425
425
// Check if media has a buffer (from PDF conversion)
426
- if ( 'buffer' in media && Buffer . isBuffer ( ( media as any ) . buffer ) ) {
426
+ if (
427
+ media &&
428
+ typeof media === 'object' &&
429
+ 'buffer' in media &&
430
+ Buffer . isBuffer ( media . buffer )
431
+ ) {
427
432
mediaBuffer = ( media as any ) . buffer ;
428
433
} else {
429
434
mediaBuffer = await this . prepareMediaBuffer ( media . url ) ;
@@ -525,14 +530,14 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
525
530
firstPost : PostDetails ,
526
531
mediaIds : string [ ] ,
527
532
type : 'company' | 'personal' ,
528
- idPdf : boolean
533
+ isPdf : boolean
529
534
) : Promise < string > {
530
535
const postPayload = this . createLinkedInPostPayload (
531
536
id ,
532
537
type ,
533
538
firstPost . message ,
534
539
mediaIds ,
535
- idPdf ,
540
+ isPdf
536
541
) ;
537
542
538
543
const response = await this . fetch ( 'https://api.linkedin.com/rest/posts' , {
@@ -546,7 +551,6 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
546
551
body : JSON . stringify ( postPayload ) ,
547
552
} ) ;
548
553
549
- console . log ( 'LinkedIn post response:' , response ) ;
550
554
if ( response . status !== 201 && response . status !== 200 ) {
551
555
throw new Error ( 'Error posting to LinkedIn' ) ;
552
556
}
You can’t perform that action at this time.
0 commit comments