Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zefir-git committed Aug 1, 2024
1 parent 461cff4 commit 223f996
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resource/Playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ namespace Playlist {

private readonly extract = {
name(body: any): string {
if (!("name" in body)) throw new ThrowableResponse(new FieldErrorResponse({expires: "Please enter a name for this playlist."}));
if (!("name" in body)) throw new ThrowableResponse(new FieldErrorResponse({name: "Please enter a name for this playlist."}));
if (typeof body.name !== "string") throw new ThrowableResponse(new FieldErrorResponse({name: "Must be a string."}));
if (body.name.length > 128) throw new ThrowableResponse(new FieldErrorResponse({note: "Must be 128 characters or less."}));
return body.name;
Expand All @@ -160,7 +160,7 @@ namespace Playlist {
return user.id;
},
visibility(body: any): Playlist.Visibility {
if (!("visibility" in body)) throw new ThrowableResponse(new FieldErrorResponse({expires: "Please select playlist visibility."}));
if (!("visibility" in body)) throw new ThrowableResponse(new FieldErrorResponse({visibility: "Please select playlist visibility."}));
if (typeof body.visibility !== "string") throw new ThrowableResponse(new FieldErrorResponse({visibility: "Must be a string."}));
if (!Object.values(Playlist.Visibility).includes(body.visibility as Playlist.Visibility)) throw new ThrowableResponse(new FieldErrorResponse({visibility: "Invalid visibility setting."}));
return body.visibility as Playlist.Visibility;
Expand Down

0 comments on commit 223f996

Please sign in to comment.