Fix creation of new creators

This commit is contained in:
2025-02-10 14:10:03 -05:00
parent a54a0d682e
commit 3de5b7e4ce
2 changed files with 8 additions and 8 deletions

View File

@@ -48,9 +48,9 @@ public sealed class CreateCreatorHandler(
.Slugs .Slugs
.SingleAsync(s => s.Id == req.SlugReservationId, ct); .SingleAsync(s => s.Id == req.SlugReservationId, ct);
if (slug.Active == false if (slug.Active == true
&& slug.ReservedUntil >= DateTime.Now || slug.ReservedUntil < DateTimeOffset.UtcNow
&& slug.CreatedBy == User.GetUserId()) || slug.CreatedBy != User.GetUserId())
{ {
await SendErrorsAsync(500, ct); await SendErrorsAsync(500, ct);
return; return;

View File

@@ -14,7 +14,7 @@ export const useCreatorProfileStore = defineStore(
() => authStore.isAuthenticated, () => authStore.isAuthenticated,
async (newValue) => { async (newValue) => {
if (newValue) { if (newValue) {
value.value = await fetchCurrentCreatorProfile(); await fetchCurrentCreatorProfile();
if (value.value === undefined) { if (value.value === undefined) {
await router.push('/'); await router.push('/');
} else { } else {
@@ -28,7 +28,7 @@ export const useCreatorProfileStore = defineStore(
const value = useSessionStorage( const value = useSessionStorage(
'creator-profile', 'creator-profile',
{}, undefined,
{writeDefaults: false} {writeDefaults: false}
); );
@@ -40,10 +40,10 @@ export const useCreatorProfileStore = defineStore(
async function fetchCurrentCreatorProfile() { async function fetchCurrentCreatorProfile() {
try { try {
const creatorResponse = await client.get(`/api/creators/profile`); const response = await client.get(`/api/creators/profile`);
return creatorResponse.data; value.value = response.data;
} catch (error) { } catch (error) {
return undefined; value.value = undefined;
} }
} }