fix: production readiness — resolve build, lint, and code quality issues
- Fix Next.js build failure: remove duplicate route at (dashboard)/listings/[id] that conflicted with (public)/listings/[id] (same URL path in two route groups) - Fix 772 ESLint errors: auto-fix import ordering (import-x/order), remove unused imports/variables, convert empty interfaces to type aliases, replace require() with ESM imports, fix consistent-type-imports violations - Add CLAUDE.md for developer onboarding documentation - All checks pass: 0 lint errors, typecheck clean, 230 tests passing, build success Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import { Injectable, type OnModuleInit } from '@nestjs/common';
|
||||
import { LoggerService } from '@modules/shared/infrastructure/logger.service';
|
||||
import * as admin from 'firebase-admin';
|
||||
import {
|
||||
apps,
|
||||
initializeApp,
|
||||
credential,
|
||||
messaging,
|
||||
type ServiceAccount,
|
||||
} from 'firebase-admin';
|
||||
import { type LoggerService } from '@modules/shared/infrastructure/logger.service';
|
||||
|
||||
export interface SendPushDto {
|
||||
token: string;
|
||||
@@ -26,9 +32,9 @@ export class FcmService implements OnModuleInit {
|
||||
}
|
||||
|
||||
try {
|
||||
const serviceAccount = JSON.parse(serviceAccountJson) as admin.ServiceAccount;
|
||||
if (!admin.apps.length) {
|
||||
admin.initializeApp({ credential: admin.credential.cert(serviceAccount) });
|
||||
const serviceAccount = JSON.parse(serviceAccountJson) as ServiceAccount;
|
||||
if (!apps.length) {
|
||||
initializeApp({ credential: credential.cert(serviceAccount) });
|
||||
}
|
||||
this.initialized = true;
|
||||
this.logger.log('Firebase Admin initialized for push notifications', 'FcmService');
|
||||
@@ -50,7 +56,7 @@ export class FcmService implements OnModuleInit {
|
||||
}
|
||||
|
||||
try {
|
||||
const messageId = await admin.messaging().send({
|
||||
const messageId = await messaging().send({
|
||||
token: dto.token,
|
||||
notification: {
|
||||
title: dto.title,
|
||||
|
||||
Reference in New Issue
Block a user