Skip to content

Commit 3e05538

Browse files
committed
style(both): fix
Signed-off-by: Me0wo <152751263+Sn0wo2@users.noreply.github.com>
1 parent a24c49f commit 3e05538

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

Frontend/src/router/Note.scss

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '../styles/variables' as vars;
1+
@use '../styles/variables';
22

33
.note-container {
44
position: fixed;
@@ -7,12 +7,12 @@
77
flex-direction: column;
88
background-color: var(--bg-secondary);
99
border-radius: 15px;
10-
box-shadow: vars.$shadow-md;
11-
font-family: vars.$font-stack;
10+
box-shadow: variables.$shadow-md;
11+
font-family: variables.$font-stack;
1212
overflow: hidden;
1313
opacity: 0;
1414
transform: scale(0.9);
15-
transition: vars.$opacity-transition, vars.$transform-transition, vars.$color-transition;
15+
transition: variables.$opacity-transition, variables.$transform-transition, variables.$color-transition;
1616

1717
&.visible {
1818
opacity: 1;
@@ -28,7 +28,7 @@
2828
font-size: 14px;
2929
color: var(--text-primary);
3030
cursor: pointer;
31-
transition: vars.$color-transition, vars.$transform-transition;
31+
transition: variables.$color-transition, variables.$transform-transition;
3232

3333
&:hover {
3434
background: var(--interactive);
@@ -46,7 +46,7 @@
4646
padding: 1px 16px;
4747
background: var(--bg-secondary);
4848
border-bottom: 1px solid var(--border-primary);
49-
z-index: vars.$z-index-middle;
49+
z-index: variables.$z-index-middle;
5050
transition: all 0.3s ease;
5151

5252
.left-buttons,
@@ -96,7 +96,7 @@
9696
padding: 12px 16px;
9797
background: var(--bg-secondary);
9898
border-bottom: 1px solid var(--border-primary);
99-
transition: vars.$color-transition;
99+
transition: variables.$color-transition;
100100
}
101101

102102
.note-title {
@@ -108,7 +108,7 @@
108108
background: var(--bg-surface);
109109
color: var(--text-primary);
110110
outline: none;
111-
transition: vars.$color-transition, vars.$transform-transition;
111+
transition: variables.$color-transition, variables.$transform-transition;
112112

113113
&:focus {
114114
border-color: var(--interactive);
@@ -120,7 +120,7 @@
120120
flex: 1;
121121
display: flex;
122122
background: var(--bg-surface);
123-
transition: vars.$color-transition;
123+
transition: variables.$color-transition;
124124

125125
&.mode-edit .note-preview,
126126
&.mode-preview .note-editor {
@@ -131,10 +131,10 @@
131131
.note-editor,
132132
.note-preview {
133133
flex: 1;
134-
font-family: vars.$font-stack;
134+
font-family: variables.$font-stack;
135135
background: var(--bg-surface);
136136
color: var(--text-primary);
137-
transition: vars.$color-transition;
137+
transition: variables.$color-transition;
138138
}
139139

140140
.note-editor {
@@ -256,7 +256,7 @@
256256
background: transparent;
257257
border: none;
258258
cursor: pointer;
259-
transition: vars.$color-transition;
259+
transition: variables.$color-transition;
260260

261261
&:hover {
262262
text-decoration: underline;

internal/router/handler/note.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ func Note() func(ctx *fiber.Ctx) error {
4141
n.Content = helper.StringToBytes(n.DisplayContent)
4242

4343
if len(n.Title) == 0 && len(n.Content) == 0 {
44-
log.Instance.Warn("Empty note, override method -> DELETE",
44+
log.Instance.Warn("Empty note! Override method -> DELETE",
4545
zap.String("nid", nid),
4646
zap.String("ctx", common.FiberContextString(ctx)))
4747

48+
// override to DELETE!
4849
ctx.Method(fiber.MethodDelete)
4950

5051
goto method
@@ -65,7 +66,6 @@ func Note() func(ctx *fiber.Ctx) error {
6566
return ctx.Status(fiber.StatusOK).JSON(response.New("success"))
6667

6768
case fiber.MethodDelete:
68-
// if note not found don't return error
6969
if err := n.Delete(); err != nil {
7070
log.Instance.Warn("Failed to delete note",
7171
zap.String("nid", nid),
@@ -100,7 +100,6 @@ func Note() func(ctx *fiber.Ctx) error {
100100
n.DisplayContent = helper.BytesToString(n.Content)
101101

102102
return ctx.Status(fiber.StatusOK).JSON(response.New(msg, n))
103-
// TODO: Too late for fallback method...
104103
default:
105104
log.Instance.Warn("Invalid note method",
106105
zap.String("nid", nid),

internal/router/notfound/not_found.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/Sn0wo2/QuickNote/pkg/common"
77
"github.com/Sn0wo2/QuickNote/pkg/log"
8+
"github.com/Sn0wo2/QuickNote/pkg/response"
89
"github.com/gofiber/fiber/v2"
910
"go.uber.org/zap"
1011
)
@@ -18,9 +19,6 @@ func Setup(msg string, router fiber.Router) {
1819
log.Instance.Warn(common.TitleCase(msg),
1920
zap.String("ctx", common.FiberContextString(ctx)))
2021

21-
return ctx.Status(fiber.StatusNotFound).JSON(fiber.Map{
22-
"success": false,
23-
"message": msg,
24-
})
22+
return ctx.Status(fiber.StatusNotFound).JSON(response.New(msg))
2523
})
2624
}

0 commit comments

Comments
 (0)