Added code to support password settings. Fixed a bug where the [FromBody] attribute resulted in null object properties, as well as included more null checks.
This commit is contained in:
@@ -403,14 +403,20 @@ BEGIN
|
||||
BEGIN TRANSACTION;
|
||||
IF dbo.UserExists(@UserName) = 1
|
||||
BEGIN;
|
||||
THROW 51000, 'User already exists', 1;
|
||||
THROW 51000, 'This username is already in use', 1;
|
||||
END;
|
||||
|
||||
IF dbo.EmailInUse(@Email) = 1
|
||||
|
||||
BEGIN;
|
||||
THROW 51001, 'This email is already in use', 1
|
||||
END;
|
||||
|
||||
SELECT @EventID = [Event ID] FROM [Event] WHERE [Event Name] = 'Registration'
|
||||
|
||||
IF @EventID = NULL OR @EventID = 0
|
||||
BEGIN;
|
||||
THROW 51001, 'Registration event type not found', 1;
|
||||
THROW 51002, 'Registration event type not found', 1;
|
||||
END;
|
||||
|
||||
INSERT INTO [User] (Name, Email) VALUES (@UserName, @Email)
|
||||
|
||||
Reference in New Issue
Block a user