Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
  • Loading branch information
patriciareinoso committed Dec 13, 2023
1 parent 0b2e7ec commit 99e07c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pages/api/device-group/[name].ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function handleGET(req: NextApiRequest, res: NextApiResponse) {
});

if (!response.ok) {
res.status(response.status).json({ error: "Error retrieving network slice." });
res.status(response.status).json({ error: "Error retrieving device group." });
return;
}

Expand Down
2 changes: 1 addition & 1 deletion pages/api/subscriber/[name].ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function handleSubscriber(req: NextApiRequest, res: NextApi
}

function isValidName(name: string): boolean {
return /^[a-zA-Z0-9-_]+$/.test(name);
return /^[a-zA-Z0-9-_]+$/.test(name);
}

async function handleGET(req: NextApiRequest, res: NextApiResponse) {
Expand Down
5 changes: 1 addition & 4 deletions utils/createSubscriber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export const createSubscriber = async ({
if (checkResponse.ok && existingSubscriberData["AuthenticationSubscription"]["authenticationMethod"]) {
throw new Error("Subscriber already exists.");
}
else{
console.error(checkResponse);
}

const response = await fetch(`/api/subscriber/imsi-${imsi}`, {
method: "POST",
Expand Down Expand Up @@ -91,7 +88,7 @@ export const createSubscriber = async ({
const details =
error instanceof Error
? error.message
: "Failed to configure the network.";
: "Failed to create the subscriber.";
throw new Error(details);
}
};

0 comments on commit 99e07c7

Please sign in to comment.