Fix creation of new creators
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user