Add missing argument to the delete/2 function.

main
absc 2024-09-15 20:28:22 +00:00
parent be8fd2e0e6
commit 3c40cc381e
1 changed files with 10 additions and 6 deletions

View File

@ -18,7 +18,7 @@
-include_lib("dudeswave_backend/include/defines.hrl"). -include_lib("dudeswave_backend/include/defines.hrl").
-include_lib("storage/include/storage.hrl"). -include_lib("storage/include/storage.hrl").
-export([details/2, new/4, update/5, delete/1]). -export([details/2, new/4, update/5, delete/2]).
-doc """ -doc """
Return user details. Return user details.
@ -136,15 +136,19 @@ update(User, Host, Name, Email, Desc) ->
Delete an existing user from the database. Delete an existing user from the database.
``` ```
-spec delete(User) -> ok | {error, Reason} when -spec delete(User, Host) -> ok | {error, Reason} when
User :: binary(), User :: binary(),
Host :: binary(),
Reason :: term(). Reason :: term().
``` ```
""". """.
-spec delete(User) -> ok | {error, Reason} when -spec delete(User, Host) -> ok | {error, Reason} when
User :: binary(), User :: binary(),
Host :: binary(),
Reason :: term(). Reason :: term().
delete(User) -> delete(User, Host) ->
ok = storage:delete(?USERSBUCK, User), ComplUser = <<User/binary, "@", Host/binary>>,
ok = storage:delete_set(?COOKIESBUCK, [{user, User}]).
ok = storage:delete(?USERSBUCK, ComplUser),
ok = storage:delete_set(?COOKIESBUCK, [{user, ComplUser}]).