BLOG-126 Post management (list and create) #139
@ -15,7 +15,7 @@ import { PostRepositoryImpl } from '$lib/post/adapter/gateway/postRepositoryImpl
|
|||||||
import { PostCreatedStore } from '$lib/post/adapter/presenter/postCreatedStore';
|
import { PostCreatedStore } from '$lib/post/adapter/presenter/postCreatedStore';
|
||||||
import type { PostInfoViewModel } from '$lib/post/adapter/presenter/postInfoViewModel';
|
import type { PostInfoViewModel } from '$lib/post/adapter/presenter/postInfoViewModel';
|
||||||
import { PostsListedStore } from '$lib/post/adapter/presenter/postsListedStore';
|
import { PostsListedStore } from '$lib/post/adapter/presenter/postsListedStore';
|
||||||
import { PostLoadedStore } from '$lib/post/adapter/presenter/PostLoadedStore';
|
import { PostLoadedStore } from '$lib/post/adapter/presenter/postLoadedStore';
|
||||||
import type { PostViewModel } from '$lib/post/adapter/presenter/postViewModel';
|
import type { PostViewModel } from '$lib/post/adapter/presenter/postViewModel';
|
||||||
import type { PostRepository } from '$lib/post/application/gateway/postRepository';
|
import type { PostRepository } from '$lib/post/application/gateway/postRepository';
|
||||||
import { CreatePostUseCase } from '$lib/post/application/useCase/createPostUseCase';
|
import { CreatePostUseCase } from '$lib/post/application/useCase/createPostUseCase';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { AsyncState } from '$lib/common/adapter/presenter/asyncState';
|
import { AsyncState } from '$lib/common/adapter/presenter/asyncState';
|
||||||
|
import type { BaseStore } from '$lib/common/adapter/presenter/baseStore';
|
||||||
import { ImageInfoViewModel } from '$lib/image/adapter/presenter/imageInfoViewModel';
|
import { ImageInfoViewModel } from '$lib/image/adapter/presenter/imageInfoViewModel';
|
||||||
import type { UploadImageUseCase } from '$lib/image/application/useCase/uploadImageUseCase';
|
import type { UploadImageUseCase } from '$lib/image/application/useCase/uploadImageUseCase';
|
||||||
import { captureException } from '@sentry/sveltekit';
|
import { captureException } from '@sentry/sveltekit';
|
||||||
@ -6,7 +7,7 @@ import { get, writable } from 'svelte/store';
|
|||||||
|
|
||||||
export type ImageInfoState = AsyncState<ImageInfoViewModel>;
|
export type ImageInfoState = AsyncState<ImageInfoViewModel>;
|
||||||
|
|
||||||
export class ImageUploadedStore {
|
export class ImageUploadedStore implements BaseStore<ImageInfoState, File> {
|
||||||
private readonly state = writable<ImageInfoState>(AsyncState.idle<ImageInfoViewModel>(null));
|
private readonly state = writable<ImageInfoState>(AsyncState.idle<ImageInfoViewModel>(null));
|
||||||
|
|
||||||
constructor(private readonly uploadImageUseCase: UploadImageUseCase) {}
|
constructor(private readonly uploadImageUseCase: UploadImageUseCase) {}
|
||||||
@ -32,6 +33,7 @@ export class ImageUploadedStore {
|
|||||||
captureException(e);
|
captureException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.state.set(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import SafeHtml from '$lib/common/framework/ui/SafeHtml.svelte';
|
import SafeHtml from '$lib/common/framework/ui/SafeHtml.svelte';
|
||||||
import generateTitle from '$lib/common/framework/ui/generateTitle';
|
import generateTitle from '$lib/common/framework/ui/generateTitle';
|
||||||
import StructuredData from '$lib/post/framework/ui/StructuredData.svelte';
|
import StructuredData from '$lib/post/framework/ui/StructuredData.svelte';
|
||||||
import { PostLoadedStore } from '$lib/post/adapter/presenter/PostLoadedStore';
|
import { PostLoadedStore } from '$lib/post/adapter/presenter/postLoadedStore';
|
||||||
|
|
||||||
const { id }: { id: string } = $props();
|
const { id }: { id: string } = $props();
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
import type { PageProps } from './$types';
|
import type { PageProps } from './$types';
|
||||||
import PostContentPage from '$lib/post/framework/ui/PostContentPage.svelte';
|
import PostContentPage from '$lib/post/framework/ui/PostContentPage.svelte';
|
||||||
import { Container } from '$lib/container';
|
import { Container } from '$lib/container';
|
||||||
import { PostLoadedStore } from '$lib/post/adapter/presenter/PostLoadedStore';
|
import { PostLoadedStore } from '$lib/post/adapter/presenter/postLoadedStore';
|
||||||
|
|
||||||
const { data, params }: PageProps = $props();
|
const { data, params }: PageProps = $props();
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user