Skip to content

Commit

Permalink
fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidid888 committed Feb 7, 2025
1 parent 71b5613 commit 986eb39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/main_endpoints/routes/Cleezy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ router.post('/createUrl', async (req, res) => {
} else if (!await decodeToken(req)) {
return res.sendStatus(UNAUTHORIZED);
}
const { url, alias, expiration_date } = req.body;
let jsonbody = { url, alias: alias || null, expiration_date: expiration_date || null };
const { url, alias, expirationDate } = req.body;
let jsonbody = { url, alias: alias || null, expirationDate: expirationDate || null };
try {
const response = await axios.post(CLEEZY_URL + '/create_url', jsonbody);
const data = response.data;
Expand Down
4 changes: 2 additions & 2 deletions src/APIFunctions/Cleezy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export async function getAllUrls({
return status;
}

export async function createUrl(url, alias = null, expiration_date = null, token) {
export async function createUrl(url, alias = null, expirationDate = null, token) {
let status = new ApiResponse();
const urlToAdd = { url, alias, expiration_date };
const urlToAdd = { url, alias, expirationDate };
try {
const url = new URL('/api/Cleezy/createUrl', BASE_API_URL);
const response = await axios
Expand Down
12 changes: 6 additions & 6 deletions src/Pages/URLShortener/URLShortener.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default function URLShortenerPage(props) {
</label>
</div>
</div>

<div className="col-span-3">
<div className="form-control">
<label className="label cursor-pointer">
Expand Down Expand Up @@ -320,7 +320,7 @@ export default function URLShortenerPage(props) {
id="expirationDate"
name="expirationDate"
value={expirationDate}
onChange={e => setExpirationDate(e.target.value + ":00")}
onChange={e => setExpirationDate(e.target.value + ':00')}
type="datetime-local"
className={INPUT_CLASS}
/>
Expand Down Expand Up @@ -507,14 +507,14 @@ export default function URLShortenerPage(props) {
if (url.expires_at === null) {
return (
<div>No Expiration Date</div>
)
);
} else {
return (
<div>{new Date(url.expires_at).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', hour: '2-digit', minute: '2-digit' })}</div>
)
);
}
})()}
</div>
})()}
</div>
</td>
<td className='hidden md:table-cell'>
<div className='flex items-center justify-center'>
Expand Down

0 comments on commit 986eb39

Please sign in to comment.