mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
chore: format code via prettier & csharpier
This commit is contained in:
@@ -143,7 +143,7 @@
|
|||||||
>
|
>
|
||||||
<History class="h-4 w-4" />
|
<History class="h-4 w-4" />
|
||||||
<span>
|
<span>
|
||||||
{#if paste.editedAt > Date.now() - 86_400_000}
|
{#if paste.editedAt > Date.now() - 86_400_000}
|
||||||
Edited {dateToRelativeString(new Date(paste.editedAt), true, false, now)}
|
Edited {dateToRelativeString(new Date(paste.editedAt), true, false, now)}
|
||||||
{:else}
|
{:else}
|
||||||
Edited on {new Date(paste.editedAt).toLocaleDateString()}
|
Edited on {new Date(paste.editedAt).toLocaleDateString()}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { error, redirect } from '@sveltejs/kit';
|
import { error, redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
export async function GET({ params }) {
|
export async function GET({ params }) {
|
||||||
const username = params?.username;
|
const username = params?.username;
|
||||||
if (!username) throw error(404, 'User not found');
|
if (!username) throw error(404, 'User not found');
|
||||||
throw redirect(302, `/user/${encodeURIComponent(username)}`);
|
throw redirect(302, `/user/${encodeURIComponent(username)}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -818,30 +818,30 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="ml-4 rounded border px-2 py-0.5 text-sm transition-colors disabled:opacity-60 disabled:cursor-not-allowed! {data
|
class="ml-4 rounded border px-2 py-0.5 text-sm transition-colors disabled:cursor-not-allowed! disabled:opacity-60 {data
|
||||||
.paste.userReaction === 1
|
.paste.userReaction === 1
|
||||||
? 'border-green-700 bg-green-900 text-green-200'
|
? 'border-green-700 bg-green-900 text-green-200'
|
||||||
: 'border-neutral-700 bg-neutral-700 text-neutral-300 hover:bg-neutral-600'}"
|
: 'border-neutral-700 bg-neutral-700 text-neutral-300 hover:bg-neutral-600'}"
|
||||||
onclick={() => reactToPaste(1)}
|
onclick={() => reactToPaste(1)}
|
||||||
disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
||||||
aria-disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
aria-disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
||||||
>
|
>
|
||||||
<ThumbsUp class="mr-1 inline-block h-4 w-4 text-green-400" />
|
<ThumbsUp class="mr-1 inline-block h-4 w-4 text-green-400" />
|
||||||
<span>{formatNumber(data.paste.likes)}</span>
|
<span>{formatNumber(data.paste.likes)}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="rounded border px-2 py-0.5 text-sm transition-colors disabled:opacity-60 disabled:cursor-not-allowed! {data
|
class="rounded border px-2 py-0.5 text-sm transition-colors disabled:cursor-not-allowed! disabled:opacity-60 {data
|
||||||
.paste.userReaction === 2
|
.paste.userReaction === 2
|
||||||
? 'border-red-700 bg-red-900 text-red-200'
|
? 'border-red-700 bg-red-900 text-red-200'
|
||||||
: 'border-neutral-700 bg-neutral-700 text-neutral-300 hover:bg-neutral-600'}"
|
: 'border-neutral-700 bg-neutral-700 text-neutral-300 hover:bg-neutral-600'}"
|
||||||
onclick={() => reactToPaste(2)}
|
onclick={() => reactToPaste(2)}
|
||||||
disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
||||||
aria-disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
aria-disabled={reactingToPaste || !$user || $user?.uuid === data.paste.author?.uuid}
|
||||||
>
|
>
|
||||||
<ThumbsDown class="mr-1 inline-block h-4 w-4 text-red-400" />
|
<ThumbsDown class="mr-1 inline-block h-4 w-4 text-red-400" />
|
||||||
<span>{formatNumber(data.paste.dislikes)}</span>
|
<span>{formatNumber(data.paste.dislikes)}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -258,7 +258,11 @@ namespace SharpbinV3.Server.Controllers
|
|||||||
if (!Enum.IsDefined(reportType))
|
if (!Enum.IsDefined(reportType))
|
||||||
return BadRequest(new { success = false, message = "Invalid report type." });
|
return BadRequest(new { success = false, message = "Invalid report type." });
|
||||||
|
|
||||||
if (!await _verificationService.VerifyAsync(new VerificationContext { Token = request.VerificationToken, Ip = HttpContext.GetRequestIP() }))
|
if (
|
||||||
|
!await _verificationService.VerifyAsync(
|
||||||
|
new VerificationContext { Token = request.VerificationToken, Ip = HttpContext.GetRequestIP() }
|
||||||
|
)
|
||||||
|
)
|
||||||
return BadRequest(new { success = false, message = "Verification failed." });
|
return BadRequest(new { success = false, message = "Verification failed." });
|
||||||
|
|
||||||
Report report = await _reportService.CreateReport(user.UUID, ReportTargetType.Paste, paste.PID, reportType, request.Description);
|
Report report = await _reportService.CreateReport(user.UUID, ReportTargetType.Paste, paste.PID, reportType, request.Description);
|
||||||
@@ -366,7 +370,11 @@ namespace SharpbinV3.Server.Controllers
|
|||||||
if (!Enum.IsDefined(reportType))
|
if (!Enum.IsDefined(reportType))
|
||||||
return BadRequest(new { success = false, message = "Invalid report type." });
|
return BadRequest(new { success = false, message = "Invalid report type." });
|
||||||
|
|
||||||
if (!await _verificationService.VerifyAsync(new VerificationContext { Token = request.VerificationToken, Ip = HttpContext.GetRequestIP() }))
|
if (
|
||||||
|
!await _verificationService.VerifyAsync(
|
||||||
|
new VerificationContext { Token = request.VerificationToken, Ip = HttpContext.GetRequestIP() }
|
||||||
|
)
|
||||||
|
)
|
||||||
return Unauthorized(new { success = false, message = "Invalid verification token." });
|
return Unauthorized(new { success = false, message = "Invalid verification token." });
|
||||||
|
|
||||||
Report report = await _reportService.CreateReport(reporter.UUID, ReportTargetType.User, uuid, reportType, request.Description);
|
Report report = await _reportService.CreateReport(reporter.UUID, ReportTargetType.User, uuid, reportType, request.Description);
|
||||||
|
|||||||
Reference in New Issue
Block a user