refactor(data): replace schema classes with readonly models
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
import {
|
||||
PrivateAlbumsResponse,
|
||||
PrivateAlbumsResponseSchema,
|
||||
PrivateAlbumUnlockResponse,
|
||||
PrivateAlbumUnlockResponseSchema,
|
||||
UnlockPrivateAlbumRequest,
|
||||
} from "@/data/schemas/private-room";
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
|
||||
import { ApiPath } from "./api_path";
|
||||
import { httpClient } from "./http_client";
|
||||
@@ -27,7 +29,7 @@ export class PrivateRoomApi {
|
||||
},
|
||||
},
|
||||
);
|
||||
return PrivateAlbumsResponse.fromJson(unwrap(env));
|
||||
return PrivateAlbumsResponseSchema.parse(unwrap(env));
|
||||
}
|
||||
|
||||
async unlockAlbum(
|
||||
@@ -38,10 +40,10 @@ export class PrivateRoomApi {
|
||||
ApiPath.privateRoomAlbumUnlock(albumId),
|
||||
{
|
||||
method: "POST",
|
||||
body: body.toJson(),
|
||||
body,
|
||||
},
|
||||
);
|
||||
return PrivateAlbumUnlockResponse.fromJson(unwrap(env));
|
||||
return PrivateAlbumUnlockResponseSchema.parse(unwrap(env));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user