Prevent race conditions by getting fresh data
If two of the same tag were to be supplied, both would be created (or attempt to be created, because the second one will fail DB unique index and throw an error). We can prevent this by fetching fresh data from the database before checking.
Showing
Please register or sign in to comment