Skip to content

Commit ffd76e1

Browse files
authored
Update edit.html
1 parent d61d5ca commit ffd76e1

File tree

1 file changed

+7
-88
lines changed

1 file changed

+7
-88
lines changed

src/Wiki/edit.html

Lines changed: 7 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -5,93 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Edit Scratch Coding Hut Wiki</title>
77
<style>
8-
/* Global reset */
9-
* {
10-
margin: 0;
11-
padding: 0;
12-
box-sizing: border-box;
13-
}
14-
15-
body {
16-
font-family: 'Arial', sans-serif;
17-
background: #fff4f4;
18-
color: #333;
19-
padding: 40px;
20-
display: flex;
21-
flex-direction: column;
22-
align-items: center;
23-
text-align: center;
24-
}
25-
26-
h1 {
27-
font-size: 3rem;
28-
color: #ff4d4d;
29-
margin-bottom: 30px;
30-
font-weight: bold;
31-
}
32-
33-
.form-container {
34-
background-color: #ffcccc;
35-
padding: 30px;
36-
border-radius: 10px;
37-
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
38-
width: 100%;
39-
max-width: 500px;
40-
margin-bottom: 30px;
41-
}
42-
43-
.form-container h2 {
44-
font-size: 1.5rem;
45-
color: #e60000;
46-
margin-bottom: 20px;
47-
}
48-
49-
input, textarea {
50-
width: 100%;
51-
padding: 15px;
52-
margin-bottom: 15px;
53-
border-radius: 8px;
54-
border: 2px solid #e60000;
55-
font-size: 1rem;
56-
outline: none;
57-
}
58-
59-
input:focus, textarea:focus {
60-
border-color: #ff4d4d;
61-
box-shadow: 0 0 5px rgba(255, 77, 77, 0.5);
62-
}
63-
64-
button {
65-
background-color: #ff4d4d;
66-
color: white;
67-
padding: 15px 30px;
68-
border: none;
69-
border-radius: 8px;
70-
cursor: pointer;
71-
font-size: 1.1rem;
72-
transition: background-color 0.3s ease;
73-
}
74-
75-
button:hover {
76-
background-color: #ff1a1a;
77-
}
78-
79-
/* Mobile Responsive Styling */
80-
@media (max-width: 768px) {
81-
.form-container {
82-
width: 90%;
83-
padding: 20px;
84-
}
85-
86-
h1 {
87-
font-size: 2.5rem;
88-
}
89-
90-
button {
91-
font-size: 1rem;
92-
padding: 12px 25px;
93-
}
94-
}
8+
/* Your existing CSS styles here */
959
</style>
9610
</head>
9711
<body>
@@ -163,6 +77,11 @@ <h2>Edit Wiki Post</h2>
16377
}
16478

16579
try {
80+
// Log to verify the values being sent
81+
console.log('Updating wiki with ID:', wikiId);
82+
console.log('Updated Title:', updatedTitle);
83+
console.log('Updated Content:', updatedContent);
84+
16685
const response = await fetch(`${backendUrl}/wikis/${wikiId}`, {
16786
method: 'PUT',
16887
headers: { 'Content-Type': 'application/json' },
@@ -175,7 +94,7 @@ <h2>Edit Wiki Post</h2>
17594

17695
if (response.ok) {
17796
alert('Wiki updated successfully!');
178-
window.location.href = 'sitemaplinks.html'; // Redirect to Wiki/wiki.html after saving
97+
window.location.href = 'sitemaplinks.html'; // Redirect to Wiki list page after saving
17998
} else {
18099
const errorDetails = await response.json();
181100
console.error('Failed to update wiki:', errorDetails);

0 commit comments

Comments
 (0)