Skip to content

Commit

Permalink
services directory type fix done
Browse files Browse the repository at this point in the history
  • Loading branch information
pinocchio-life-like committed Dec 27, 2024
1 parent 5ed6678 commit 65f1b6f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/src/services/auth/logoutService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User as UserRepository } from 'src/drizzle/methods/User';
import { User as UserRepository } from '../../drizzle/methods/User';

export const logoutService = async (refreshToken: string) => {
const userRepository = new UserRepository();
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/auth/refreshTokenService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as jwt from 'hono/jwt';
import { User as UserRepository } from 'src/drizzle/methods/User';
import { User as UserRepository } from '../../drizzle/methods/User';

export const refreshTokenService = async (
jwtSecret: string,
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/favorite/getUserFavoritesService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Feed } from '../../modules/feed/model';
import { User } from '../../drizzle/methods/User';
import { PaginationParams } from 'src/helpers/pagination';
import { PaginationParams } from '../../helpers/pagination';

/**
* Retrieves the favorite packs associated with a specific user.
Expand Down
8 changes: 7 additions & 1 deletion server/src/services/geojsonStorage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class GeojsonStorageService {
}

public static get instance(): R2Bucket {
if (!GeojsonStorageService._instance) {
if (!GeojsonStorageService._instance || !GeojsonStorageService._bucket) {
throw new Error('GeojsonStorageService instance not initialized.');
}
return GeojsonStorageService._bucket;
Expand All @@ -24,13 +24,19 @@ export class GeojsonStorageService {
geojson: string,
resourceId: string,
): Promise<R2Object | null> {
if (!this._bucket) {
throw new Error('GeojsonStorageService bucket not initialized.');
}
return this._bucket.put(`${resource}/${resourceId}`, geojson);
}

public static async retrieve(
resource: ResourceType,
resourceId: string,
): Promise<R2ObjectBody | null> {
if (!this._bucket) {
throw new Error('GeojsonStorageService bucket not initialized.');
}
return this._bucket.get(`${resource}/${resourceId}`);
}
}

0 comments on commit 65f1b6f

Please sign in to comment.